@strapi/strapi 5.0.0-beta.8 → 5.0.0-beta.9

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 (95) hide show
  1. package/dist/cli/commands/index.d.ts.map +1 -1
  2. package/dist/cli/commands/index.js +1 -14
  3. package/dist/cli/commands/index.js.map +1 -1
  4. package/dist/cli/commands/index.mjs +1 -14
  5. package/dist/cli/commands/index.mjs.map +1 -1
  6. package/dist/cli/index.d.ts.map +1 -1
  7. package/dist/cli/index.js +30 -0
  8. package/dist/cli/index.js.map +1 -1
  9. package/dist/cli/index.mjs +30 -0
  10. package/dist/cli/index.mjs.map +1 -1
  11. package/package.json +23 -23
  12. package/dist/cli/commands/plugin/build.d.ts +0 -7
  13. package/dist/cli/commands/plugin/build.d.ts.map +0 -1
  14. package/dist/cli/commands/plugin/build.js +0 -88
  15. package/dist/cli/commands/plugin/build.js.map +0 -1
  16. package/dist/cli/commands/plugin/build.mjs +0 -85
  17. package/dist/cli/commands/plugin/build.mjs.map +0 -1
  18. package/dist/cli/commands/plugin/init/action.d.ts +0 -6
  19. package/dist/cli/commands/plugin/init/action.d.ts.map +0 -1
  20. package/dist/cli/commands/plugin/init/action.js +0 -413
  21. package/dist/cli/commands/plugin/init/action.js.map +0 -1
  22. package/dist/cli/commands/plugin/init/action.mjs +0 -408
  23. package/dist/cli/commands/plugin/init/action.mjs.map +0 -1
  24. package/dist/cli/commands/plugin/init/command.d.ts +0 -7
  25. package/dist/cli/commands/plugin/init/command.d.ts.map +0 -1
  26. package/dist/cli/commands/plugin/init/command.js +0 -9
  27. package/dist/cli/commands/plugin/init/command.js.map +0 -1
  28. package/dist/cli/commands/plugin/init/command.mjs +0 -10
  29. package/dist/cli/commands/plugin/init/command.mjs.map +0 -1
  30. package/dist/cli/commands/plugin/init/files/admin.d.ts +0 -5
  31. package/dist/cli/commands/plugin/init/files/admin.d.ts.map +0 -1
  32. package/dist/cli/commands/plugin/init/files/admin.js +0 -283
  33. package/dist/cli/commands/plugin/init/files/admin.js.map +0 -1
  34. package/dist/cli/commands/plugin/init/files/admin.mjs +0 -283
  35. package/dist/cli/commands/plugin/init/files/admin.mjs.map +0 -1
  36. package/dist/cli/commands/plugin/init/files/editorConfig.d.ts +0 -4
  37. package/dist/cli/commands/plugin/init/files/editorConfig.d.ts.map +0 -1
  38. package/dist/cli/commands/plugin/init/files/editorConfig.js +0 -26
  39. package/dist/cli/commands/plugin/init/files/editorConfig.js.map +0 -1
  40. package/dist/cli/commands/plugin/init/files/editorConfig.mjs +0 -26
  41. package/dist/cli/commands/plugin/init/files/editorConfig.mjs.map +0 -1
  42. package/dist/cli/commands/plugin/init/files/eslint.d.ts +0 -4
  43. package/dist/cli/commands/plugin/init/files/eslint.d.ts.map +0 -1
  44. package/dist/cli/commands/plugin/init/files/eslint.js +0 -11
  45. package/dist/cli/commands/plugin/init/files/eslint.js.map +0 -1
  46. package/dist/cli/commands/plugin/init/files/eslint.mjs +0 -11
  47. package/dist/cli/commands/plugin/init/files/eslint.mjs.map +0 -1
  48. package/dist/cli/commands/plugin/init/files/gitIgnore.d.ts +0 -4
  49. package/dist/cli/commands/plugin/init/files/gitIgnore.d.ts.map +0 -1
  50. package/dist/cli/commands/plugin/init/files/gitIgnore.js +0 -34
  51. package/dist/cli/commands/plugin/init/files/gitIgnore.js.map +0 -1
  52. package/dist/cli/commands/plugin/init/files/gitIgnore.mjs +0 -34
  53. package/dist/cli/commands/plugin/init/files/gitIgnore.mjs.map +0 -1
  54. package/dist/cli/commands/plugin/init/files/prettier.d.ts +0 -5
  55. package/dist/cli/commands/plugin/init/files/prettier.d.ts.map +0 -1
  56. package/dist/cli/commands/plugin/init/files/prettier.js +0 -25
  57. package/dist/cli/commands/plugin/init/files/prettier.js.map +0 -1
  58. package/dist/cli/commands/plugin/init/files/prettier.mjs +0 -25
  59. package/dist/cli/commands/plugin/init/files/prettier.mjs.map +0 -1
  60. package/dist/cli/commands/plugin/init/files/server.d.ts +0 -5
  61. package/dist/cli/commands/plugin/init/files/server.d.ts.map +0 -1
  62. package/dist/cli/commands/plugin/init/files/server.js +0 -360
  63. package/dist/cli/commands/plugin/init/files/server.js.map +0 -1
  64. package/dist/cli/commands/plugin/init/files/server.mjs +0 -360
  65. package/dist/cli/commands/plugin/init/files/server.mjs.map +0 -1
  66. package/dist/cli/commands/plugin/init/files/typescript.d.ts +0 -9
  67. package/dist/cli/commands/plugin/init/files/typescript.d.ts.map +0 -1
  68. package/dist/cli/commands/plugin/init/files/typescript.js +0 -66
  69. package/dist/cli/commands/plugin/init/files/typescript.js.map +0 -1
  70. package/dist/cli/commands/plugin/init/files/typescript.mjs +0 -66
  71. package/dist/cli/commands/plugin/init/files/typescript.mjs.map +0 -1
  72. package/dist/cli/commands/plugin/init/index.d.ts +0 -2
  73. package/dist/cli/commands/plugin/init/index.d.ts.map +0 -1
  74. package/dist/cli/commands/plugin/link-watch.d.ts +0 -7
  75. package/dist/cli/commands/plugin/link-watch.d.ts.map +0 -1
  76. package/dist/cli/commands/plugin/link-watch.js +0 -89
  77. package/dist/cli/commands/plugin/link-watch.js.map +0 -1
  78. package/dist/cli/commands/plugin/link-watch.mjs +0 -82
  79. package/dist/cli/commands/plugin/link-watch.mjs.map +0 -1
  80. package/dist/cli/commands/plugin/verify.d.ts +0 -7
  81. package/dist/cli/commands/plugin/verify.d.ts.map +0 -1
  82. package/dist/cli/commands/plugin/verify.js +0 -37
  83. package/dist/cli/commands/plugin/verify.js.map +0 -1
  84. package/dist/cli/commands/plugin/verify.mjs +0 -34
  85. package/dist/cli/commands/plugin/verify.mjs.map +0 -1
  86. package/dist/cli/commands/plugin/watch.d.ts +0 -7
  87. package/dist/cli/commands/plugin/watch.d.ts.map +0 -1
  88. package/dist/cli/commands/plugin/watch.js +0 -86
  89. package/dist/cli/commands/plugin/watch.js.map +0 -1
  90. package/dist/cli/commands/plugin/watch.mjs +0 -83
  91. package/dist/cli/commands/plugin/watch.mjs.map +0 -1
  92. package/dist/cli/utils/pkg.js +0 -111
  93. package/dist/cli/utils/pkg.js.map +0 -1
  94. package/dist/cli/utils/pkg.mjs +0 -87
  95. package/dist/cli/utils/pkg.mjs.map +0 -1
@@ -1,4 +0,0 @@
1
- import { TemplateFile } from '@strapi/pack-up';
2
- declare const eslintIgnoreFile: TemplateFile;
3
- export { eslintIgnoreFile };
4
- //# sourceMappingURL=eslint.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"eslint.d.ts","sourceRoot":"","sources":["../../../../../../src/cli/commands/plugin/init/files/eslint.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAG/C,QAAA,MAAM,gBAAgB,EAAE,YAKvB,CAAC;AAEF,OAAO,EAAE,gBAAgB,EAAE,CAAC"}
@@ -1,11 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
- const outdent = require("outdent");
4
- const eslintIgnoreFile = {
5
- name: ".eslintignore",
6
- contents: outdent.outdent`
7
- dist
8
- `
9
- };
10
- exports.eslintIgnoreFile = eslintIgnoreFile;
11
- //# sourceMappingURL=eslint.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"eslint.js","sources":["../../../../../../src/cli/commands/plugin/init/files/eslint.ts"],"sourcesContent":["import { TemplateFile } from '@strapi/pack-up';\nimport { outdent } from 'outdent';\n\nconst eslintIgnoreFile: TemplateFile = {\n name: '.eslintignore',\n contents: outdent`\n dist\n `,\n};\n\nexport { eslintIgnoreFile };\n"],"names":["outdent"],"mappings":";;;AAGA,MAAM,mBAAiC;AAAA,EACrC,MAAM;AAAA,EACN,UAAUA,QAAAA;AAAAA;AAAAA;AAGZ;;"}
@@ -1,11 +0,0 @@
1
- import { outdent } from "outdent";
2
- const eslintIgnoreFile = {
3
- name: ".eslintignore",
4
- contents: outdent`
5
- dist
6
- `
7
- };
8
- export {
9
- eslintIgnoreFile
10
- };
11
- //# sourceMappingURL=eslint.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"eslint.mjs","sources":["../../../../../../src/cli/commands/plugin/init/files/eslint.ts"],"sourcesContent":["import { TemplateFile } from '@strapi/pack-up';\nimport { outdent } from 'outdent';\n\nconst eslintIgnoreFile: TemplateFile = {\n name: '.eslintignore',\n contents: outdent`\n dist\n `,\n};\n\nexport { eslintIgnoreFile };\n"],"names":[],"mappings":";AAGA,MAAM,mBAAiC;AAAA,EACrC,MAAM;AAAA,EACN,UAAU;AAAA;AAAA;AAGZ;"}
@@ -1,4 +0,0 @@
1
- import { TemplateFile } from '@strapi/pack-up';
2
- declare const gitIgnoreFile: TemplateFile;
3
- export { gitIgnoreFile };
4
- //# sourceMappingURL=gitIgnore.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"gitIgnore.d.ts","sourceRoot":"","sources":["../../../../../../src/cli/commands/plugin/init/files/gitIgnore.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAG/C,QAAA,MAAM,aAAa,EAAE,YA4BpB,CAAC;AAEF,OAAO,EAAE,aAAa,EAAE,CAAC"}
@@ -1,34 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
- const outdent = require("outdent");
4
- const gitIgnoreFile = {
5
- name: ".gitignore",
6
- contents: outdent.outdent`
7
- # See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
8
-
9
- # dependencies
10
- node_modules
11
- .pnp
12
- .pnp.js
13
-
14
- # testing
15
- coverage
16
-
17
- # production
18
- dist
19
-
20
- # misc
21
- .DS_Store
22
- *.pem
23
-
24
- # debug
25
- npm-debug.log*
26
- yarn-debug.log*
27
- yarn-error.log*
28
-
29
- # local env files
30
- .env
31
- `
32
- };
33
- exports.gitIgnoreFile = gitIgnoreFile;
34
- //# sourceMappingURL=gitIgnore.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"gitIgnore.js","sources":["../../../../../../src/cli/commands/plugin/init/files/gitIgnore.ts"],"sourcesContent":["import { TemplateFile } from '@strapi/pack-up';\nimport { outdent } from 'outdent';\n\nconst gitIgnoreFile: TemplateFile = {\n name: '.gitignore',\n contents: outdent`\n # See https://help.github.com/articles/ignoring-files/ for more about ignoring files.\n\n # dependencies\n node_modules\n .pnp\n .pnp.js\n \n # testing\n coverage\n \n # production\n dist\n \n # misc\n .DS_Store\n *.pem\n \n # debug\n npm-debug.log*\n yarn-debug.log*\n yarn-error.log*\n \n # local env files\n .env \n `,\n};\n\nexport { gitIgnoreFile };\n"],"names":["outdent"],"mappings":";;;AAGA,MAAM,gBAA8B;AAAA,EAClC,MAAM;AAAA,EACN,UAAUA,QAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AA0BZ;;"}
@@ -1,34 +0,0 @@
1
- import { outdent } from "outdent";
2
- const gitIgnoreFile = {
3
- name: ".gitignore",
4
- contents: outdent`
5
- # See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
6
-
7
- # dependencies
8
- node_modules
9
- .pnp
10
- .pnp.js
11
-
12
- # testing
13
- coverage
14
-
15
- # production
16
- dist
17
-
18
- # misc
19
- .DS_Store
20
- *.pem
21
-
22
- # debug
23
- npm-debug.log*
24
- yarn-debug.log*
25
- yarn-error.log*
26
-
27
- # local env files
28
- .env
29
- `
30
- };
31
- export {
32
- gitIgnoreFile
33
- };
34
- //# sourceMappingURL=gitIgnore.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"gitIgnore.mjs","sources":["../../../../../../src/cli/commands/plugin/init/files/gitIgnore.ts"],"sourcesContent":["import { TemplateFile } from '@strapi/pack-up';\nimport { outdent } from 'outdent';\n\nconst gitIgnoreFile: TemplateFile = {\n name: '.gitignore',\n contents: outdent`\n # See https://help.github.com/articles/ignoring-files/ for more about ignoring files.\n\n # dependencies\n node_modules\n .pnp\n .pnp.js\n \n # testing\n coverage\n \n # production\n dist\n \n # misc\n .DS_Store\n *.pem\n \n # debug\n npm-debug.log*\n yarn-debug.log*\n yarn-error.log*\n \n # local env files\n .env \n `,\n};\n\nexport { gitIgnoreFile };\n"],"names":[],"mappings":";AAGA,MAAM,gBAA8B;AAAA,EAClC,MAAM;AAAA,EACN,UAAU;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AA0BZ;"}
@@ -1,5 +0,0 @@
1
- import { TemplateFile } from '@strapi/pack-up';
2
- declare const prettierFile: TemplateFile;
3
- declare const prettierIgnoreFile: TemplateFile;
4
- export { prettierFile, prettierIgnoreFile };
5
- //# sourceMappingURL=prettier.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"prettier.d.ts","sourceRoot":"","sources":["../../../../../../src/cli/commands/plugin/init/files/prettier.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAG/C,QAAA,MAAM,YAAY,EAAE,YAWnB,CAAC;AAEF,QAAA,MAAM,kBAAkB,EAAE,YAMzB,CAAC;AAEF,OAAO,EAAE,YAAY,EAAE,kBAAkB,EAAE,CAAC"}
@@ -1,25 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
- const outdent = require("outdent");
4
- const prettierFile = {
5
- name: ".prettierrc",
6
- contents: outdent.outdent`
7
- {
8
- "endOfLine": 'lf',
9
- "tabWidth": 2,
10
- "printWidth": 100,
11
- "singleQuote": true,
12
- "trailingComma": 'es5',
13
- }
14
- `
15
- };
16
- const prettierIgnoreFile = {
17
- name: ".prettierignore",
18
- contents: outdent.outdent`
19
- dist
20
- coverage
21
- `
22
- };
23
- exports.prettierFile = prettierFile;
24
- exports.prettierIgnoreFile = prettierIgnoreFile;
25
- //# sourceMappingURL=prettier.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"prettier.js","sources":["../../../../../../src/cli/commands/plugin/init/files/prettier.ts"],"sourcesContent":["import { TemplateFile } from '@strapi/pack-up';\nimport { outdent } from 'outdent';\n\nconst prettierFile: TemplateFile = {\n name: '.prettierrc',\n contents: outdent`\n {\n \"endOfLine\": 'lf',\n \"tabWidth\": 2,\n \"printWidth\": 100,\n \"singleQuote\": true,\n \"trailingComma\": 'es5',\n }\n `,\n};\n\nconst prettierIgnoreFile: TemplateFile = {\n name: '.prettierignore',\n contents: outdent`\n dist\n coverage\n `,\n};\n\nexport { prettierFile, prettierIgnoreFile };\n"],"names":["outdent"],"mappings":";;;AAGA,MAAM,eAA6B;AAAA,EACjC,MAAM;AAAA,EACN,UAAUA,QAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AASZ;AAEA,MAAM,qBAAmC;AAAA,EACvC,MAAM;AAAA,EACN,UAAUA,QAAAA;AAAAA;AAAAA;AAAAA;AAIZ;;;"}
@@ -1,25 +0,0 @@
1
- import { outdent } from "outdent";
2
- const prettierFile = {
3
- name: ".prettierrc",
4
- contents: outdent`
5
- {
6
- "endOfLine": 'lf',
7
- "tabWidth": 2,
8
- "printWidth": 100,
9
- "singleQuote": true,
10
- "trailingComma": 'es5',
11
- }
12
- `
13
- };
14
- const prettierIgnoreFile = {
15
- name: ".prettierignore",
16
- contents: outdent`
17
- dist
18
- coverage
19
- `
20
- };
21
- export {
22
- prettierFile,
23
- prettierIgnoreFile
24
- };
25
- //# sourceMappingURL=prettier.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"prettier.mjs","sources":["../../../../../../src/cli/commands/plugin/init/files/prettier.ts"],"sourcesContent":["import { TemplateFile } from '@strapi/pack-up';\nimport { outdent } from 'outdent';\n\nconst prettierFile: TemplateFile = {\n name: '.prettierrc',\n contents: outdent`\n {\n \"endOfLine\": 'lf',\n \"tabWidth\": 2,\n \"printWidth\": 100,\n \"singleQuote\": true,\n \"trailingComma\": 'es5',\n }\n `,\n};\n\nconst prettierIgnoreFile: TemplateFile = {\n name: '.prettierignore',\n contents: outdent`\n dist\n coverage\n `,\n};\n\nexport { prettierFile, prettierIgnoreFile };\n"],"names":[],"mappings":";AAGA,MAAM,eAA6B;AAAA,EACjC,MAAM;AAAA,EACN,UAAU;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AASZ;AAEA,MAAM,qBAAmC;AAAA,EACvC,MAAM;AAAA,EACN,UAAU;AAAA;AAAA;AAAA;AAIZ;"}
@@ -1,5 +0,0 @@
1
- import { TemplateFile } from '@strapi/pack-up';
2
- declare const TYPESCRIPT: (pluginName: string) => TemplateFile[];
3
- declare const JAVASCRIPT: (pluginName: string) => TemplateFile[];
4
- export { TYPESCRIPT as serverTypescriptFiles, JAVASCRIPT as serverJavascriptFiles };
5
- //# sourceMappingURL=server.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"server.d.ts","sourceRoot":"","sources":["../../../../../../src/cli/commands/plugin/init/files/server.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAG/C,QAAA,MAAM,UAAU,eAAgB,MAAM,KAAG,YAAY,EAwKpD,CAAC;AAEF,QAAA,MAAM,UAAU,eAAgB,MAAM,KAAG,YAAY,EAwLpD,CAAC;AAEF,OAAO,EAAE,UAAU,IAAI,qBAAqB,EAAE,UAAU,IAAI,qBAAqB,EAAE,CAAC"}
@@ -1,360 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
- const outdent = require("outdent");
4
- const TYPESCRIPT = (pluginName) => [
5
- {
6
- name: "server/src/index.ts",
7
- contents: outdent.outdent`
8
- /**
9
- * Application methods
10
- */
11
- import bootstrap from './bootstrap';
12
- import destroy from './destroy';
13
- import register from './register';
14
-
15
- /**
16
- * Plugin server methods
17
- */
18
- import config from './config';
19
- import contentTypes from './content-types';
20
- import controllers from './controllers';
21
- import middlewares from './middlewares';
22
- import policies from './policies';
23
- import routes from './routes';
24
- import services from './services';
25
-
26
- export default {
27
- bootstrap,
28
- destroy,
29
- register,
30
-
31
- config,
32
- controllers,
33
- contentTypes,
34
- middlewares,
35
- policies,
36
- routes,
37
- services,
38
- };
39
- `
40
- },
41
- {
42
- name: "server/src/bootstrap.ts",
43
- contents: outdent.outdent`
44
- import type { Core } from '@strapi/strapi';
45
-
46
- const bootstrap = ({ strapi }: { strapi: Core.Strapi }) => {
47
- // bootstrap phase
48
- };
49
-
50
- export default bootstrap;
51
- `
52
- },
53
- {
54
- name: "server/src/destroy.ts",
55
- contents: outdent.outdent`
56
- import type { Core } from '@strapi/strapi';
57
-
58
- const destroy = ({ strapi }: { strapi: Core.Strapi }) => {
59
- // destroy phase
60
- };
61
-
62
- export default destroy;
63
- `
64
- },
65
- {
66
- name: "server/src/register.ts",
67
- contents: outdent.outdent`
68
- import type { Core } from '@strapi/strapi';
69
-
70
- const register = ({ strapi }: { strapi: Core.Strapi }) => {
71
- // register phase
72
- };
73
-
74
- export default register;
75
- `
76
- },
77
- {
78
- name: "server/src/config/index.ts",
79
- contents: outdent.outdent`
80
- export default {
81
- default: {},
82
- validator() {},
83
- };
84
- `
85
- },
86
- {
87
- name: "server/src/content-types/index.ts",
88
- contents: outdent.outdent`
89
- export default {};
90
- `
91
- },
92
- {
93
- name: "server/src/controllers/index.ts",
94
- contents: outdent.outdent`
95
- import controller from './controller';
96
-
97
- export default {
98
- controller,
99
- };
100
- `
101
- },
102
- {
103
- name: "server/src/controllers/controller.ts",
104
- contents: outdent.outdent`
105
- import type { Core } from '@strapi/strapi';
106
-
107
- const controller = ({ strapi }: { strapi: Core.Strapi }) => ({
108
- index(ctx) {
109
- ctx.body = strapi
110
- .plugin('${pluginName}')
111
- // the name of the service file & the method.
112
- .service('service')
113
- .getWelcomeMessage();
114
- },
115
- });
116
-
117
- export default controller
118
- `
119
- },
120
- {
121
- name: "server/src/middlewares/index.ts",
122
- contents: outdent.outdent`
123
- export default {};
124
- `
125
- },
126
- {
127
- name: "server/src/policies/index.ts",
128
- contents: outdent.outdent`
129
- export default {};
130
- `
131
- },
132
- {
133
- name: "server/src/routes/index.ts",
134
- contents: outdent.outdent`
135
- export default [
136
- {
137
- method: 'GET',
138
- path: '/',
139
- // name of the controller file & the method.
140
- handler: 'controller.index',
141
- config: {
142
- policies: [],
143
- },
144
- },
145
- ];
146
- `
147
- },
148
- {
149
- name: "server/src/services/index.ts",
150
- contents: outdent.outdent`
151
- import service from './service';
152
-
153
- export default {
154
- service,
155
- };
156
- `
157
- },
158
- {
159
- name: "server/src/services/service.ts",
160
- contents: outdent.outdent`
161
- import type { Core } from '@strapi/strapi';
162
-
163
- const service = ({ strapi }: { strapi: Core.Strapi }) => ({
164
- getWelcomeMessage() {
165
- return 'Welcome to Strapi 🚀';
166
- },
167
- });
168
-
169
- export default service
170
- `
171
- }
172
- ];
173
- const JAVASCRIPT = (pluginName) => [
174
- {
175
- name: "server/src/index.ts",
176
- contents: outdent.outdent`
177
- 'use strict';
178
-
179
- /**
180
- * Application methods
181
- */
182
- const bootstrap = require('./bootstrap');
183
- const destroy = require('./destroy');
184
- const register = require('./register');
185
-
186
- /**
187
- * Plugin server methods
188
- */
189
- const config = require('./config');
190
- const contentTypes = require('./content-types');
191
- const controllers = require('./controllers');
192
- const middlewares = require('./middlewares');
193
- const policies = require('./policies');
194
- const routes = require('./routes');
195
- const services = require('./services');
196
-
197
- module.exports = {
198
- bootstrap,
199
- destroy,
200
- register,
201
-
202
- config,
203
- controllers,
204
- contentTypes,
205
- middlewares,
206
- policies,
207
- routes,
208
- services,
209
- };
210
- `
211
- },
212
- {
213
- name: "server/src/bootstrap.ts",
214
- contents: outdent.outdent`
215
- 'use strict';
216
-
217
- const bootstrap = ({ strapi }) => {
218
- // bootstrap phase
219
- };
220
-
221
- module.exports = bootstrap;
222
- `
223
- },
224
- {
225
- name: "server/src/destroy.ts",
226
- contents: outdent.outdent`
227
- 'use strict';
228
-
229
- const destroy = ({ strapi }) => {
230
- // destroy phase
231
- };
232
-
233
- module.exports = destroy;
234
- `
235
- },
236
- {
237
- name: "server/src/register.ts",
238
- contents: outdent.outdent`
239
- 'use strict';
240
-
241
- const register = ({ strapi }) => {
242
- // register phase
243
- };
244
-
245
- module.exports = register;
246
- `
247
- },
248
- {
249
- name: "server/src/config/index.ts",
250
- contents: outdent.outdent`
251
- 'use strict';
252
-
253
- module.exports = {
254
- default: {},
255
- validator() {},
256
- };
257
- `
258
- },
259
- {
260
- name: "server/src/content-types/index.ts",
261
- contents: outdent.outdent`
262
- 'use strict';
263
-
264
- module.exports = {};
265
- `
266
- },
267
- {
268
- name: "server/src/controllers/index.ts",
269
- contents: outdent.outdent`
270
- 'use strict';
271
-
272
- const controller = require('./controller');
273
-
274
- module.exports = {
275
- controller,
276
- };
277
- `
278
- },
279
- {
280
- name: "server/src/controllers/controller.ts",
281
- contents: outdent.outdent`
282
- 'use strict';
283
-
284
- const controller = ({ strapi }) => ({
285
- index(ctx) {
286
- ctx.body = strapi
287
- .plugin('${pluginName}')
288
- // the name of the service file & the method.
289
- .service('service')
290
- .getWelcomeMessage();
291
- },
292
- });
293
-
294
- module.exports = controller
295
- `
296
- },
297
- {
298
- name: "server/src/middlewares/index.ts",
299
- contents: outdent.outdent`
300
- 'use strict';
301
-
302
- module.exports = {};
303
- `
304
- },
305
- {
306
- name: "server/src/policies/index.ts",
307
- contents: outdent.outdent`
308
- 'use strict';
309
-
310
- module.exports = {};
311
- `
312
- },
313
- {
314
- name: "server/src/routes/index.ts",
315
- contents: outdent.outdent`
316
- 'use strict';
317
-
318
- module.exports = [
319
- {
320
- method: 'GET',
321
- path: '/',
322
- // name of the controller file & the method.
323
- handler: 'controller.index',
324
- config: {
325
- policies: [],
326
- },
327
- },
328
- ];
329
- `
330
- },
331
- {
332
- name: "server/src/services/index.ts",
333
- contents: outdent.outdent`
334
- 'use strict';
335
-
336
- const service = require('./service');
337
-
338
- module.exports = {
339
- service,
340
- };
341
- `
342
- },
343
- {
344
- name: "server/src/services/service.ts",
345
- contents: outdent.outdent`
346
- 'use strict';
347
-
348
- const service = ({ strapi }) => ({
349
- getWelcomeMessage() {
350
- return 'Welcome to Strapi 🚀';
351
- },
352
- });
353
-
354
- module.exports = service
355
- `
356
- }
357
- ];
358
- exports.serverJavascriptFiles = JAVASCRIPT;
359
- exports.serverTypescriptFiles = TYPESCRIPT;
360
- //# sourceMappingURL=server.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"server.js","sources":["../../../../../../src/cli/commands/plugin/init/files/server.ts"],"sourcesContent":["import { TemplateFile } from '@strapi/pack-up';\nimport { outdent } from 'outdent';\n\nconst TYPESCRIPT = (pluginName: string): TemplateFile[] => [\n {\n name: 'server/src/index.ts',\n contents: outdent`\n /**\n * Application methods\n */\n import bootstrap from './bootstrap';\n import destroy from './destroy';\n import register from './register';\n\n /**\n * Plugin server methods\n */\n import config from './config';\n import contentTypes from './content-types';\n import controllers from './controllers';\n import middlewares from './middlewares';\n import policies from './policies';\n import routes from './routes';\n import services from './services';\n\n export default {\n bootstrap,\n destroy,\n register,\n\n config,\n controllers,\n contentTypes,\n middlewares,\n policies,\n routes,\n services,\n };\n `,\n },\n {\n name: 'server/src/bootstrap.ts',\n contents: outdent`\n import type { Core } from '@strapi/strapi';\n\n const bootstrap = ({ strapi }: { strapi: Core.Strapi }) => {\n // bootstrap phase\n };\n\n export default bootstrap;\n `,\n },\n {\n name: 'server/src/destroy.ts',\n contents: outdent`\n import type { Core } from '@strapi/strapi';\n\n const destroy = ({ strapi }: { strapi: Core.Strapi }) => {\n // destroy phase\n };\n\n export default destroy;\n `,\n },\n {\n name: 'server/src/register.ts',\n contents: outdent`\n import type { Core } from '@strapi/strapi';\n\n const register = ({ strapi }: { strapi: Core.Strapi }) => {\n // register phase\n };\n\n export default register;\n `,\n },\n {\n name: 'server/src/config/index.ts',\n contents: outdent`\n export default {\n default: {},\n validator() {},\n };\n `,\n },\n {\n name: 'server/src/content-types/index.ts',\n contents: outdent`\n export default {};\n `,\n },\n {\n name: 'server/src/controllers/index.ts',\n contents: outdent`\n import controller from './controller';\n\n export default {\n controller,\n };\n `,\n },\n {\n name: 'server/src/controllers/controller.ts',\n contents: outdent`\n import type { Core } from '@strapi/strapi';\n\n const controller = ({ strapi }: { strapi: Core.Strapi }) => ({\n index(ctx) {\n ctx.body = strapi\n .plugin('${pluginName}')\n // the name of the service file & the method.\n .service('service')\n .getWelcomeMessage();\n },\n });\n\n export default controller\n `,\n },\n {\n name: 'server/src/middlewares/index.ts',\n contents: outdent`\n export default {};\n `,\n },\n {\n name: 'server/src/policies/index.ts',\n contents: outdent`\n export default {};\n `,\n },\n {\n name: 'server/src/routes/index.ts',\n contents: outdent`\n export default [\n {\n method: 'GET',\n path: '/',\n // name of the controller file & the method.\n handler: 'controller.index',\n config: {\n policies: [],\n },\n },\n ];\n `,\n },\n {\n name: 'server/src/services/index.ts',\n contents: outdent`\n import service from './service';\n\n export default {\n service,\n };\n `,\n },\n {\n name: 'server/src/services/service.ts',\n contents: outdent`\n import type { Core } from '@strapi/strapi';\n\n const service = ({ strapi }: { strapi: Core.Strapi }) => ({\n getWelcomeMessage() {\n return 'Welcome to Strapi 🚀';\n },\n });\n\n export default service\n `,\n },\n];\n\nconst JAVASCRIPT = (pluginName: string): TemplateFile[] => [\n {\n name: 'server/src/index.ts',\n contents: outdent`\n 'use strict';\n\n /**\n * Application methods\n */\n const bootstrap = require('./bootstrap');\n const destroy = require('./destroy');\n const register = require('./register');\n\n /**\n * Plugin server methods\n */\n const config = require('./config');\n const contentTypes = require('./content-types');\n const controllers = require('./controllers');\n const middlewares = require('./middlewares');\n const policies = require('./policies');\n const routes = require('./routes');\n const services = require('./services');\n\n module.exports = {\n bootstrap,\n destroy,\n register,\n\n config,\n controllers,\n contentTypes,\n middlewares,\n policies,\n routes,\n services,\n };\n `,\n },\n {\n name: 'server/src/bootstrap.ts',\n contents: outdent`\n 'use strict';\n\n const bootstrap = ({ strapi }) => {\n // bootstrap phase\n };\n\n module.exports = bootstrap;\n `,\n },\n {\n name: 'server/src/destroy.ts',\n contents: outdent`\n 'use strict';\n\n const destroy = ({ strapi }) => {\n // destroy phase\n };\n\n module.exports = destroy;\n `,\n },\n {\n name: 'server/src/register.ts',\n contents: outdent`\n 'use strict';\n\n const register = ({ strapi }) => {\n // register phase\n };\n\n module.exports = register;\n `,\n },\n {\n name: 'server/src/config/index.ts',\n contents: outdent`\n 'use strict';\n\n module.exports = {\n default: {},\n validator() {},\n };\n `,\n },\n {\n name: 'server/src/content-types/index.ts',\n contents: outdent`\n 'use strict';\n\n module.exports = {};\n `,\n },\n {\n name: 'server/src/controllers/index.ts',\n contents: outdent`\n 'use strict';\n\n const controller = require('./controller');\n\n module.exports = {\n controller,\n };\n `,\n },\n {\n name: 'server/src/controllers/controller.ts',\n contents: outdent`\n 'use strict';\n\n const controller = ({ strapi }) => ({\n index(ctx) {\n ctx.body = strapi\n .plugin('${pluginName}')\n // the name of the service file & the method.\n .service('service')\n .getWelcomeMessage();\n },\n });\n\n module.exports = controller\n `,\n },\n {\n name: 'server/src/middlewares/index.ts',\n contents: outdent`\n 'use strict';\n\n module.exports = {};\n `,\n },\n {\n name: 'server/src/policies/index.ts',\n contents: outdent`\n 'use strict';\n\n module.exports = {};\n `,\n },\n {\n name: 'server/src/routes/index.ts',\n contents: outdent`\n 'use strict';\n\n module.exports = [\n {\n method: 'GET',\n path: '/',\n // name of the controller file & the method.\n handler: 'controller.index',\n config: {\n policies: [],\n },\n },\n ];\n `,\n },\n {\n name: 'server/src/services/index.ts',\n contents: outdent`\n 'use strict';\n\n const service = require('./service');\n\n module.exports = {\n service,\n };\n `,\n },\n {\n name: 'server/src/services/service.ts',\n contents: outdent`\n 'use strict';\n\n const service = ({ strapi }) => ({\n getWelcomeMessage() {\n return 'Welcome to Strapi 🚀';\n },\n });\n\n module.exports = service\n `,\n },\n];\n\nexport { TYPESCRIPT as serverTypescriptFiles, JAVASCRIPT as serverJavascriptFiles };\n"],"names":["outdent"],"mappings":";;;AAGM,MAAA,aAAa,CAAC,eAAuC;AAAA,EACzD;AAAA,IACE,MAAM;AAAA,IACN,UAAUA,QAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA,EAiCZ;AAAA,EACA;AAAA,IACE,MAAM;AAAA,IACN,UAAUA,QAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA,EASZ;AAAA,EACA;AAAA,IACE,MAAM;AAAA,IACN,UAAUA,QAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA,EASZ;AAAA,EACA;AAAA,IACE,MAAM;AAAA,IACN,UAAUA,QAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA,EASZ;AAAA,EACA;AAAA,IACE,MAAM;AAAA,IACN,UAAUA,QAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA,EAMZ;AAAA,EACA;AAAA,IACE,MAAM;AAAA,IACN,UAAUA,QAAAA;AAAAA;AAAAA;AAAAA,EAGZ;AAAA,EACA;AAAA,IACE,MAAM;AAAA,IACN,UAAUA,QAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA,EAOZ;AAAA,EACA;AAAA,IACE,MAAM;AAAA,IACN,UAAUA,QAAAA;AAAAA;AAAAA;AAAAA;AA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