@strapi/strapi 5.0.0-beta.1 → 5.0.0-beta.10

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 (250) hide show
  1. package/README.md +4 -4
  2. package/dist/admin.d.ts.map +1 -1
  3. package/dist/admin.js +12 -4
  4. package/dist/admin.js.map +1 -1
  5. package/dist/admin.mjs +10 -4
  6. package/dist/admin.mjs.map +1 -1
  7. package/dist/cli/commands/admin/create-user.js +2 -2
  8. package/dist/cli/commands/admin/create-user.js.map +1 -1
  9. package/dist/cli/commands/admin/create-user.mjs +88 -0
  10. package/dist/cli/commands/admin/create-user.mjs.map +1 -0
  11. package/dist/cli/commands/admin/reset-user-password.js +2 -2
  12. package/dist/cli/commands/admin/reset-user-password.js.map +1 -1
  13. package/dist/cli/commands/admin/reset-user-password.mjs +44 -0
  14. package/dist/cli/commands/admin/reset-user-password.mjs.map +1 -0
  15. package/dist/cli/commands/build.mjs +30 -0
  16. package/dist/cli/commands/build.mjs.map +1 -0
  17. package/dist/cli/commands/components/list.js +2 -2
  18. package/dist/cli/commands/components/list.js.map +1 -1
  19. package/dist/cli/commands/components/list.mjs +24 -0
  20. package/dist/cli/commands/components/list.mjs.map +1 -0
  21. package/dist/cli/commands/configuration/dump.js +2 -2
  22. package/dist/cli/commands/configuration/dump.js.map +1 -1
  23. package/dist/cli/commands/configuration/dump.mjs +41 -0
  24. package/dist/cli/commands/configuration/dump.mjs.map +1 -0
  25. package/dist/cli/commands/configuration/restore.js +2 -2
  26. package/dist/cli/commands/configuration/restore.js.map +1 -1
  27. package/dist/cli/commands/configuration/restore.mjs +140 -0
  28. package/dist/cli/commands/configuration/restore.mjs.map +1 -0
  29. package/dist/cli/commands/console.js +2 -2
  30. package/dist/cli/commands/console.js.map +1 -1
  31. package/dist/cli/commands/console.mjs +27 -0
  32. package/dist/cli/commands/console.mjs.map +1 -0
  33. package/dist/cli/commands/content-types/list.js +2 -2
  34. package/dist/cli/commands/content-types/list.js.map +1 -1
  35. package/dist/cli/commands/content-types/list.mjs +24 -0
  36. package/dist/cli/commands/content-types/list.mjs.map +1 -0
  37. package/dist/cli/commands/controllers/list.js +2 -2
  38. package/dist/cli/commands/controllers/list.js.map +1 -1
  39. package/dist/cli/commands/controllers/list.mjs +24 -0
  40. package/dist/cli/commands/controllers/list.mjs.map +1 -0
  41. package/dist/cli/commands/develop.mjs +27 -0
  42. package/dist/cli/commands/develop.mjs.map +1 -0
  43. package/dist/cli/commands/export/action.js.map +1 -1
  44. package/dist/cli/commands/export/action.mjs +116 -0
  45. package/dist/cli/commands/export/action.mjs.map +1 -0
  46. package/dist/cli/commands/export/command.mjs +24 -0
  47. package/dist/cli/commands/export/command.mjs.map +1 -0
  48. package/dist/cli/commands/generate.mjs +13 -0
  49. package/dist/cli/commands/generate.mjs.map +1 -0
  50. package/dist/cli/commands/hooks/list.js +2 -2
  51. package/dist/cli/commands/hooks/list.js.map +1 -1
  52. package/dist/cli/commands/hooks/list.mjs +24 -0
  53. package/dist/cli/commands/hooks/list.mjs.map +1 -0
  54. package/dist/cli/commands/import/action.js.map +1 -1
  55. package/dist/cli/commands/import/action.mjs +105 -0
  56. package/dist/cli/commands/import/action.mjs.map +1 -0
  57. package/dist/cli/commands/import/command.mjs +68 -0
  58. package/dist/cli/commands/import/command.mjs.map +1 -0
  59. package/dist/cli/commands/index.d.ts.map +1 -1
  60. package/dist/cli/commands/index.js +1 -14
  61. package/dist/cli/commands/index.js.map +1 -1
  62. package/dist/cli/commands/index.mjs +58 -0
  63. package/dist/cli/commands/index.mjs.map +1 -0
  64. package/dist/cli/commands/middlewares/list.js +2 -2
  65. package/dist/cli/commands/middlewares/list.js.map +1 -1
  66. package/dist/cli/commands/middlewares/list.mjs +24 -0
  67. package/dist/cli/commands/middlewares/list.mjs.map +1 -0
  68. package/dist/cli/commands/plugin/init/files/typescript.d.ts.map +1 -1
  69. package/dist/cli/commands/policies/list.js +2 -2
  70. package/dist/cli/commands/policies/list.js.map +1 -1
  71. package/dist/cli/commands/policies/list.mjs +24 -0
  72. package/dist/cli/commands/policies/list.mjs.map +1 -0
  73. package/dist/cli/commands/report.js +2 -2
  74. package/dist/cli/commands/report.js.map +1 -1
  75. package/dist/cli/commands/report.mjs +35 -0
  76. package/dist/cli/commands/report.mjs.map +1 -0
  77. package/dist/cli/commands/routes/list.js +2 -2
  78. package/dist/cli/commands/routes/list.js.map +1 -1
  79. package/dist/cli/commands/routes/list.mjs +28 -0
  80. package/dist/cli/commands/routes/list.mjs.map +1 -0
  81. package/dist/cli/commands/services/list.js +2 -2
  82. package/dist/cli/commands/services/list.js.map +1 -1
  83. package/dist/cli/commands/services/list.mjs +24 -0
  84. package/dist/cli/commands/services/list.mjs.map +1 -0
  85. package/dist/cli/commands/start.js +1 -1
  86. package/dist/cli/commands/start.js.map +1 -1
  87. package/dist/cli/commands/start.mjs +24 -0
  88. package/dist/cli/commands/start.mjs.map +1 -0
  89. package/dist/cli/commands/telemetry/disable.mjs +67 -0
  90. package/dist/cli/commands/telemetry/disable.mjs.map +1 -0
  91. package/dist/cli/commands/telemetry/enable.mjs +86 -0
  92. package/dist/cli/commands/telemetry/enable.mjs.map +1 -0
  93. package/dist/cli/commands/templates/generate.mjs +74 -0
  94. package/dist/cli/commands/templates/generate.mjs.map +1 -0
  95. package/dist/cli/commands/transfer/action.mjs +131 -0
  96. package/dist/cli/commands/transfer/action.mjs.map +1 -0
  97. package/dist/cli/commands/transfer/command.mjs +84 -0
  98. package/dist/cli/commands/transfer/command.mjs.map +1 -0
  99. package/dist/cli/commands/ts/generate-types.d.ts.map +1 -1
  100. package/dist/cli/commands/ts/generate-types.js +4 -5
  101. package/dist/cli/commands/ts/generate-types.js.map +1 -1
  102. package/dist/cli/commands/ts/generate-types.mjs +34 -0
  103. package/dist/cli/commands/ts/generate-types.mjs.map +1 -0
  104. package/dist/cli/commands/version.mjs +13 -0
  105. package/dist/cli/commands/version.mjs.map +1 -0
  106. package/dist/cli/index.d.ts.map +1 -1
  107. package/dist/cli/index.js +30 -0
  108. package/dist/cli/index.js.map +1 -1
  109. package/dist/cli/index.mjs +79 -0
  110. package/dist/cli/index.mjs.map +1 -0
  111. package/dist/cli/utils/commander.d.ts +2 -2
  112. package/dist/cli/utils/commander.d.ts.map +1 -1
  113. package/dist/cli/utils/commander.mjs +109 -0
  114. package/dist/cli/utils/commander.mjs.map +1 -0
  115. package/dist/cli/utils/data-transfer.d.ts +4 -4
  116. package/dist/cli/utils/data-transfer.d.ts.map +1 -1
  117. package/dist/cli/utils/data-transfer.js +32 -24
  118. package/dist/cli/utils/data-transfer.js.map +1 -1
  119. package/dist/cli/utils/data-transfer.mjs +347 -0
  120. package/dist/cli/utils/data-transfer.mjs.map +1 -0
  121. package/dist/cli/utils/helpers.d.ts +1 -1
  122. package/dist/cli/utils/helpers.d.ts.map +1 -1
  123. package/dist/cli/utils/helpers.mjs +100 -0
  124. package/dist/cli/utils/helpers.mjs.map +1 -0
  125. package/dist/cli/utils/logger.mjs +80 -0
  126. package/dist/cli/utils/logger.mjs.map +1 -0
  127. package/dist/cli/utils/pkg.d.ts.map +1 -1
  128. package/dist/cli/utils/telemetry.mjs +22 -0
  129. package/dist/cli/utils/telemetry.mjs.map +1 -0
  130. package/dist/cli/utils/tsconfig.d.ts.map +1 -1
  131. package/dist/cli/utils/tsconfig.mjs +23 -0
  132. package/dist/cli/utils/tsconfig.mjs.map +1 -0
  133. package/dist/node/build.mjs +58 -0
  134. package/dist/node/build.mjs.map +1 -0
  135. package/dist/node/core/admin-customisations.mjs +22 -0
  136. package/dist/node/core/admin-customisations.mjs.map +1 -0
  137. package/dist/node/core/aliases.d.ts +1 -1
  138. package/dist/node/core/aliases.d.ts.map +1 -1
  139. package/dist/node/core/aliases.js +8 -5
  140. package/dist/node/core/aliases.js.map +1 -1
  141. package/dist/node/core/aliases.mjs +31 -0
  142. package/dist/node/core/aliases.mjs.map +1 -0
  143. package/dist/node/core/config.d.ts.map +1 -1
  144. package/dist/node/core/config.mjs +16 -0
  145. package/dist/node/core/config.mjs.map +1 -0
  146. package/dist/node/core/dependencies.d.ts.map +1 -1
  147. package/dist/node/core/dependencies.js +5 -1
  148. package/dist/node/core/dependencies.js.map +1 -1
  149. package/dist/node/core/dependencies.mjs +155 -0
  150. package/dist/node/core/dependencies.mjs.map +1 -0
  151. package/dist/node/core/env.d.ts.map +1 -1
  152. package/dist/node/core/env.js +7 -4
  153. package/dist/node/core/env.js.map +1 -1
  154. package/dist/node/core/env.mjs +23 -0
  155. package/dist/node/core/env.mjs.map +1 -0
  156. package/dist/node/core/errors.mjs +29 -0
  157. package/dist/node/core/errors.mjs.map +1 -0
  158. package/dist/node/core/files.mjs +43 -0
  159. package/dist/node/core/files.mjs.map +1 -0
  160. package/dist/node/core/managers.mjs +17 -0
  161. package/dist/node/core/managers.mjs.map +1 -0
  162. package/dist/node/core/monorepo.mjs +20 -0
  163. package/dist/node/core/monorepo.mjs.map +1 -0
  164. package/dist/node/core/plugins.mjs +93 -0
  165. package/dist/node/core/plugins.mjs.map +1 -0
  166. package/dist/node/core/timer.mjs +27 -0
  167. package/dist/node/core/timer.mjs.map +1 -0
  168. package/dist/node/create-build-context.d.ts.map +1 -1
  169. package/dist/node/create-build-context.js +1 -1
  170. package/dist/node/create-build-context.js.map +1 -1
  171. package/dist/node/create-build-context.mjs +91 -0
  172. package/dist/node/create-build-context.mjs.map +1 -0
  173. package/dist/node/develop.js +1 -1
  174. package/dist/node/develop.js.map +1 -1
  175. package/dist/node/develop.mjs +252 -0
  176. package/dist/node/develop.mjs.map +1 -0
  177. package/dist/node/staticFiles.d.ts.map +1 -1
  178. package/dist/node/staticFiles.js +25 -3
  179. package/dist/node/staticFiles.js.map +1 -1
  180. package/dist/node/staticFiles.mjs +76 -0
  181. package/dist/node/staticFiles.mjs.map +1 -0
  182. package/dist/node/vite/build.mjs +12 -0
  183. package/dist/node/vite/build.mjs.map +1 -0
  184. package/dist/node/vite/config.mjs +99 -0
  185. package/dist/node/vite/config.mjs.map +1 -0
  186. package/dist/node/vite/plugins.mjs +43 -0
  187. package/dist/node/vite/plugins.mjs.map +1 -0
  188. package/dist/node/vite/watch.mjs +52 -0
  189. package/dist/node/vite/watch.mjs.map +1 -0
  190. package/dist/node/webpack/build.mjs +39 -0
  191. package/dist/node/webpack/build.mjs.map +1 -0
  192. package/dist/node/webpack/config.mjs +228 -0
  193. package/dist/node/webpack/config.mjs.map +1 -0
  194. package/dist/node/webpack/watch.mjs +92 -0
  195. package/dist/node/webpack/watch.mjs.map +1 -0
  196. package/package.json +33 -40
  197. package/dist/cli/commands/plugin/build.d.ts +0 -7
  198. package/dist/cli/commands/plugin/build.d.ts.map +0 -1
  199. package/dist/cli/commands/plugin/build.js +0 -88
  200. package/dist/cli/commands/plugin/build.js.map +0 -1
  201. package/dist/cli/commands/plugin/init/action.d.ts +0 -6
  202. package/dist/cli/commands/plugin/init/action.d.ts.map +0 -1
  203. package/dist/cli/commands/plugin/init/action.js +0 -414
  204. package/dist/cli/commands/plugin/init/action.js.map +0 -1
  205. package/dist/cli/commands/plugin/init/command.d.ts +0 -7
  206. package/dist/cli/commands/plugin/init/command.d.ts.map +0 -1
  207. package/dist/cli/commands/plugin/init/command.js +0 -9
  208. package/dist/cli/commands/plugin/init/command.js.map +0 -1
  209. package/dist/cli/commands/plugin/init/files/admin.d.ts +0 -5
  210. package/dist/cli/commands/plugin/init/files/admin.d.ts.map +0 -1
  211. package/dist/cli/commands/plugin/init/files/admin.js +0 -283
  212. package/dist/cli/commands/plugin/init/files/admin.js.map +0 -1
  213. package/dist/cli/commands/plugin/init/files/editorConfig.d.ts +0 -4
  214. package/dist/cli/commands/plugin/init/files/editorConfig.d.ts.map +0 -1
  215. package/dist/cli/commands/plugin/init/files/editorConfig.js +0 -26
  216. package/dist/cli/commands/plugin/init/files/editorConfig.js.map +0 -1
  217. package/dist/cli/commands/plugin/init/files/eslint.d.ts +0 -4
  218. package/dist/cli/commands/plugin/init/files/eslint.d.ts.map +0 -1
  219. package/dist/cli/commands/plugin/init/files/eslint.js +0 -11
  220. package/dist/cli/commands/plugin/init/files/eslint.js.map +0 -1
  221. package/dist/cli/commands/plugin/init/files/gitIgnore.d.ts +0 -4
  222. package/dist/cli/commands/plugin/init/files/gitIgnore.d.ts.map +0 -1
  223. package/dist/cli/commands/plugin/init/files/gitIgnore.js +0 -34
  224. package/dist/cli/commands/plugin/init/files/gitIgnore.js.map +0 -1
  225. package/dist/cli/commands/plugin/init/files/prettier.d.ts +0 -5
  226. package/dist/cli/commands/plugin/init/files/prettier.d.ts.map +0 -1
  227. package/dist/cli/commands/plugin/init/files/prettier.js +0 -25
  228. package/dist/cli/commands/plugin/init/files/prettier.js.map +0 -1
  229. package/dist/cli/commands/plugin/init/files/server.d.ts +0 -5
  230. package/dist/cli/commands/plugin/init/files/server.d.ts.map +0 -1
  231. package/dist/cli/commands/plugin/init/files/server.js +0 -360
  232. package/dist/cli/commands/plugin/init/files/server.js.map +0 -1
  233. package/dist/cli/commands/plugin/init/files/typescript.js +0 -66
  234. package/dist/cli/commands/plugin/init/files/typescript.js.map +0 -1
  235. package/dist/cli/commands/plugin/init/index.d.ts +0 -2
  236. package/dist/cli/commands/plugin/init/index.d.ts.map +0 -1
  237. package/dist/cli/commands/plugin/link-watch.d.ts +0 -7
  238. package/dist/cli/commands/plugin/link-watch.d.ts.map +0 -1
  239. package/dist/cli/commands/plugin/link-watch.js +0 -89
  240. package/dist/cli/commands/plugin/link-watch.js.map +0 -1
  241. package/dist/cli/commands/plugin/verify.d.ts +0 -7
  242. package/dist/cli/commands/plugin/verify.d.ts.map +0 -1
  243. package/dist/cli/commands/plugin/verify.js +0 -37
  244. package/dist/cli/commands/plugin/verify.js.map +0 -1
  245. package/dist/cli/commands/plugin/watch.d.ts +0 -7
  246. package/dist/cli/commands/plugin/watch.d.ts.map +0 -1
  247. package/dist/cli/commands/plugin/watch.js +0 -86
  248. package/dist/cli/commands/plugin/watch.js.map +0 -1
  249. package/dist/cli/utils/pkg.js +0 -108
  250. package/dist/cli/utils/pkg.js.map +0 -1
@@ -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,I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AA;AAAAA;AAAAA,EAeZ;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;AAAAA;AAAAA,EAWZ;AACF;;;"}
@@ -1,66 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
- const outdent = require("outdent");
4
- const ADMIN = {
5
- tsconfigFile: {
6
- name: "admin/tsconfig.json",
7
- contents: outdent.outdent`
8
- {
9
- "extends": "@strapi/typescript-utils/tsconfigs/admin",
10
- "include": ["./src", "./custom.d.ts"],
11
- "compilerOptions": {
12
- "rootDir": "../",
13
- "baseUrl": ".",
14
- },
15
- }
16
- `
17
- },
18
- tsconfigBuildFile: {
19
- name: "admin/tsconfig.build.json",
20
- contents: outdent.outdent`
21
- {
22
- "extends": "./tsconfig",
23
- "include": ["./src", "./custom.d.ts"],
24
- "exclude": ["**/*.test.ts", "**/*.test.tsx"],
25
- "compilerOptions": {
26
- "rootDir": "../",
27
- "baseUrl": ".",
28
- "outDir": "./dist",
29
- }
30
- }
31
- `
32
- }
33
- };
34
- const SERVER = {
35
- tsconfigFile: {
36
- name: "server/tsconfig.json",
37
- contents: outdent.outdent`
38
- {
39
- "extends": "@strapi/typescript-utils/tsconfigs/server",
40
- "include": ["./src"],
41
- "compilerOptions": {
42
- "rootDir": "../",
43
- "baseUrl": ".",
44
- },
45
- }
46
- `
47
- },
48
- tsconfigBuildFile: {
49
- name: "server/tsconfig.build.json",
50
- contents: outdent.outdent`
51
- {
52
- "extends": "./tsconfig",
53
- "include": ["./src"],
54
- "exclude": ["**/*.test.ts"],
55
- "compilerOptions": {
56
- "rootDir": "../",
57
- "baseUrl": ".",
58
- "outDir": "./dist",
59
- }
60
- }
61
- `
62
- }
63
- };
64
- exports.adminTsconfigFiles = ADMIN;
65
- exports.serverTsconfigFiles = SERVER;
66
- //# sourceMappingURL=typescript.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"typescript.js","sources":["../../../../../../src/cli/commands/plugin/init/files/typescript.ts"],"sourcesContent":["import { TemplateFile } from '@strapi/pack-up';\nimport { outdent } from 'outdent';\n\ninterface TsConfigFiles {\n tsconfigFile: TemplateFile;\n tsconfigBuildFile: TemplateFile;\n}\n\nconst ADMIN: TsConfigFiles = {\n tsconfigFile: {\n name: 'admin/tsconfig.json',\n contents: outdent`\n {\n \"extends\": \"@strapi/typescript-utils/tsconfigs/admin\",\n \"include\": [\"./src\", \"./custom.d.ts\"],\n \"compilerOptions\": {\n \"rootDir\": \"../\",\n \"baseUrl\": \".\",\n },\n }\n `,\n },\n tsconfigBuildFile: {\n name: 'admin/tsconfig.build.json',\n contents: outdent`\n {\n \"extends\": \"./tsconfig\",\n \"include\": [\"./src\", \"./custom.d.ts\"],\n \"exclude\": [\"**/*.test.ts\", \"**/*.test.tsx\"],\n \"compilerOptions\": {\n \"rootDir\": \"../\",\n \"baseUrl\": \".\",\n \"outDir\": \"./dist\",\n }\n }\n `,\n },\n};\n\nconst SERVER: TsConfigFiles = {\n tsconfigFile: {\n name: 'server/tsconfig.json',\n contents: outdent`\n {\n \"extends\": \"@strapi/typescript-utils/tsconfigs/server\",\n \"include\": [\"./src\"],\n \"compilerOptions\": {\n \"rootDir\": \"../\",\n \"baseUrl\": \".\",\n },\n }\n `,\n },\n tsconfigBuildFile: {\n name: 'server/tsconfig.build.json',\n contents: outdent`\n {\n \"extends\": \"./tsconfig\",\n \"include\": [\"./src\"],\n \"exclude\": [\"**/*.test.ts\"],\n \"compilerOptions\": {\n \"rootDir\": \"../\",\n \"baseUrl\": \".\",\n \"outDir\": \"./dist\",\n }\n }\n `,\n },\n};\n\nexport { ADMIN as adminTsconfigFiles, SERVER as serverTsconfigFiles };\n"],"names":["outdent"],"mappings":";;;AAQA,MAAM,QAAuB;AAAA,EAC3B,cAAc;AAAA,IACZ,MAAM;AAAA,IACN,UAAUA,QAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA,EAUZ;AAAA,EACA,mBAAmB;AAAA,IACjB,MAAM;AAAA,IACN,UAAUA,QAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA,EAYZ;AACF;AAEA,MAAM,SAAwB;AAAA,EAC5B,cAAc;AAAA,IACZ,MAAM;AAAA,IACN,UAAUA,QAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA,EAUZ;AAAA,EACA,mBAAmB;AAAA,IACjB,MAAM;AAAA,IACN,UAAUA,QAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA,EAYZ;AACF;;;"}
@@ -1,2 +0,0 @@
1
- export { default as command } from './command';
2
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/cli/commands/plugin/init/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,OAAO,EAAE,MAAM,WAAW,CAAC"}
@@ -1,7 +0,0 @@
1
- import type { StrapiCommand } from '../../types';
2
- /**
3
- * `$ strapi plugin:watch:link`
4
- */
5
- declare const command: StrapiCommand;
6
- export { command };
7
- //# sourceMappingURL=link-watch.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"link-watch.d.ts","sourceRoot":"","sources":["../../../../src/cli/commands/plugin/link-watch.ts"],"names":[],"mappings":"AASA,OAAO,KAAK,EAAc,aAAa,EAAE,MAAM,aAAa,CAAC;AAqF7D;;GAEG;AACH,QAAA,MAAM,OAAO,EAAE,aAOd,CAAC;AAEF,OAAO,EAAE,OAAO,EAAE,CAAC"}
@@ -1,89 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
- const boxen = require("boxen");
4
- const chalk = require("chalk");
5
- const concurrently = require("concurrently");
6
- const fs = require("node:fs/promises");
7
- const path = require("node:path");
8
- const nodemon = require("nodemon");
9
- const outdent = require("outdent");
10
- const helpers = require("../../utils/helpers.js");
11
- const pkg = require("../../utils/pkg.js");
12
- const _interopDefault = (e) => e && e.__esModule ? e : { default: e };
13
- const boxen__default = /* @__PURE__ */ _interopDefault(boxen);
14
- const chalk__default = /* @__PURE__ */ _interopDefault(chalk);
15
- const concurrently__default = /* @__PURE__ */ _interopDefault(concurrently);
16
- const fs__default = /* @__PURE__ */ _interopDefault(fs);
17
- const path__default = /* @__PURE__ */ _interopDefault(path);
18
- const nodemon__default = /* @__PURE__ */ _interopDefault(nodemon);
19
- const action = async (_opts, _cmd, { cwd, logger }) => {
20
- try {
21
- const outDir = "./dist";
22
- const extensions = "ts,js,png,svg,gif,jpeg,css";
23
- nodemon__default.default({
24
- watch: [outDir],
25
- ext: extensions,
26
- exec: "yalc push --changed"
27
- });
28
- const folder = path__default.default.join(cwd, outDir);
29
- if (!await pathExists(folder)) {
30
- await fs__default.default.mkdir(folder);
31
- }
32
- const pkg$1 = await pkg.loadPkg({ cwd, logger });
33
- const pkgJson = await pkg.validatePkg({ pkg: pkg$1 });
34
- concurrently__default.default(["npm run watch"]);
35
- nodemon__default.default.on("start", () => {
36
- logger.info(
37
- outdent.outdent`
38
- Watching ${outDir} for changes to files with extensions: ${extensions}
39
-
40
- To use this package in Strapi, in a separate shell run:
41
- cd /path/to/strapi/project
42
-
43
- Then run one of the commands below based on the package manager used in that project:
44
-
45
- ## yarn
46
- ${chalk__default.default.greenBright(`yarn dlx yalc add --link ${pkgJson.name} && yarn install`)}
47
-
48
- ## npm
49
- ${chalk__default.default.greenBright(
50
- `npx yalc add ${pkgJson.name} && npx yalc link ${pkgJson.name} && npm install`
51
- )}
52
- `.trimStart()
53
- );
54
- }).on("quit", () => {
55
- process.exit();
56
- }).on("restart", (files) => {
57
- logger.info("Found changes in files:", chalk__default.default.magentaBright(files));
58
- logger.info("Pushing new yalc package...");
59
- });
60
- } catch (err) {
61
- logger.error(
62
- "There seems to be an unexpected error, try again with --debug for more information \n"
63
- );
64
- if (err instanceof Error && err.stack) {
65
- console.log(
66
- chalk__default.default.red(
67
- boxen__default.default(err.stack, {
68
- padding: 1,
69
- align: "left"
70
- })
71
- )
72
- );
73
- }
74
- process.exit(1);
75
- }
76
- };
77
- const pathExists = async (path2) => {
78
- try {
79
- await fs__default.default.access(path2);
80
- return true;
81
- } catch (error) {
82
- return false;
83
- }
84
- };
85
- const command = ({ command: command2, ctx }) => {
86
- command2.command("plugin:watch:link").description("Recompiles your plugin automatically on changes and runs yalc push --publish").option("-d, --debug", "Enable debugging mode with verbose logs", false).option("--silent", "Don't log anything", false).action((...args) => helpers.runAction("plugin:watch:link", action)(...args, ctx));
87
- };
88
- exports.command = command;
89
- //# sourceMappingURL=link-watch.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"link-watch.js","sources":["../../../../src/cli/commands/plugin/link-watch.ts"],"sourcesContent":["import boxen from 'boxen';\nimport chalk from 'chalk';\nimport concurrently from 'concurrently';\nimport fs from 'node:fs/promises';\nimport path from 'node:path';\nimport nodemon from 'nodemon';\nimport { outdent } from 'outdent';\n\nimport { runAction } from '../../utils/helpers';\nimport type { CLIContext, StrapiCommand } from '../../types';\nimport { loadPkg, validatePkg } from '../../utils/pkg';\n\ninterface ActionOptions {}\n\nconst action = async (_opts: ActionOptions, _cmd: unknown, { cwd, logger }: CLIContext) => {\n try {\n const outDir = './dist';\n const extensions = 'ts,js,png,svg,gif,jpeg,css';\n\n nodemon({\n watch: [outDir],\n ext: extensions,\n exec: 'yalc push --changed',\n });\n\n const folder = path.join(cwd, outDir);\n\n if (!(await pathExists(folder))) {\n await fs.mkdir(folder);\n }\n\n const pkg = await loadPkg({ cwd, logger });\n const pkgJson = await validatePkg({ pkg });\n\n concurrently(['npm run watch']);\n\n nodemon\n .on('start', () => {\n logger.info(\n outdent`\n Watching ${outDir} for changes to files with extensions: ${extensions}\n\n To use this package in Strapi, in a separate shell run:\n cd /path/to/strapi/project\n\n Then run one of the commands below based on the package manager used in that project:\n\n ## yarn\n ${chalk.greenBright(`yarn dlx yalc add --link ${pkgJson.name} && yarn install`)}\n\n ## npm\n ${chalk.greenBright(\n `npx yalc add ${pkgJson.name} && npx yalc link ${pkgJson.name} && npm install`\n )}\n `.trimStart()\n );\n })\n .on('quit', () => {\n process.exit();\n })\n .on('restart', (files) => {\n logger.info('Found changes in files:', chalk.magentaBright(files));\n logger.info('Pushing new yalc package...');\n });\n } catch (err) {\n logger.error(\n 'There seems to be an unexpected error, try again with --debug for more information \\n'\n );\n if (err instanceof Error && err.stack) {\n console.log(\n chalk.red(\n boxen(err.stack, {\n padding: 1,\n align: 'left',\n })\n )\n );\n }\n process.exit(1);\n }\n};\n\n/**\n * @internal\n */\nconst pathExists = async (path: string) => {\n try {\n await fs.access(path);\n return true;\n } catch (error) {\n return false;\n }\n};\n\n/**\n * `$ strapi plugin:watch:link`\n */\nconst command: StrapiCommand = ({ command, ctx }) => {\n command\n .command('plugin:watch:link')\n .description('Recompiles your plugin automatically on changes and runs yalc push --publish')\n .option('-d, --debug', 'Enable debugging mode with verbose logs', false)\n .option('--silent', \"Don't log anything\", false)\n .action((...args) => runAction('plugin:watch:link', action)(...args, ctx));\n};\n\nexport { command };\n"],"names":["nodemon","path","fs","pkg","loadPkg","validatePkg","concurrently","outdent","chalk","boxen","command","runAction"],"mappings":";;;;;;;;;;;;;;;;;;AAcA,MAAM,SAAS,OAAO,OAAsB,MAAe,EAAE,KAAK,aAAyB;AACrF,MAAA;AACF,UAAM,SAAS;AACf,UAAM,aAAa;AAEXA,6BAAA;AAAA,MACN,OAAO,CAAC,M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AA;AACI,UAAAC,YAAA,QAAG,OAAOD,KAAI;AACb,WAAA;AAAA,WACA,OAAO;AACP,WAAA;AAAA,EACT;AACF;AAKA,MAAM,UAAyB,CAAC,EAAE,SAAAS,UAAS,UAAU;AACnDA,WACG,QAAQ,mBAAmB,EAC3B,YAAY,8EAA8E,EAC1F,OAAO,eAAe,2CAA2C,KAAK,EACtE,OAAO,YAAY,sBAAsB,KAAK,EAC9C,OAAO,IAAI,SAASC,QAAAA,UAAU,qBAAqB,MAAM,EAAE,GAAG,MAAM,GAAG,CAAC;AAC7E;;"}
@@ -1,7 +0,0 @@
1
- import type { StrapiCommand } from '../../types';
2
- /**
3
- * `$ strapi plugin:verify`
4
- */
5
- declare const command: StrapiCommand;
6
- export { command };
7
- //# sourceMappingURL=verify.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"verify.d.ts","sourceRoot":"","sources":["../../../../src/cli/commands/plugin/verify.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,aAAa,EAAc,MAAM,aAAa,CAAC;AA4B7D;;GAEG;AACH,QAAA,MAAM,OAAO,EAAE,aAOd,CAAC;AAEF,OAAO,EAAE,OAAO,EAAE,CAAC"}
@@ -1,37 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
- const boxen = require("boxen");
4
- const chalk = require("chalk");
5
- const packUp = require("@strapi/pack-up");
6
- const helpers = require("../../utils/helpers.js");
7
- const _interopDefault = (e) => e && e.__esModule ? e : { default: e };
8
- const boxen__default = /* @__PURE__ */ _interopDefault(boxen);
9
- const chalk__default = /* @__PURE__ */ _interopDefault(chalk);
10
- const action = async (opts, _cmd, { cwd, logger }) => {
11
- try {
12
- await packUp.check({
13
- cwd,
14
- ...opts
15
- });
16
- } catch (err) {
17
- logger.error(
18
- "There seems to be an unexpected error, try again with --debug for more information \n"
19
- );
20
- if (err instanceof Error && err.stack) {
21
- console.log(
22
- chalk__default.default.red(
23
- boxen__default.default(err.stack, {
24
- padding: 1,
25
- align: "left"
26
- })
27
- )
28
- );
29
- }
30
- process.exit(1);
31
- }
32
- };
33
- const command = ({ command: command2, ctx }) => {
34
- command2.command("plugin:verify").description("Verify the output of your plugin before publishing it.").option("-d, --debug", "Enable debugging mode with verbose logs", false).option("--silent", "Don't log anything", false).action((...args) => helpers.runAction("plugin:verify", action)(...args, ctx));
35
- };
36
- exports.command = command;
37
- //# sourceMappingURL=verify.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"verify.js","sources":["../../../../src/cli/commands/plugin/verify.ts"],"sourcesContent":["import boxen from 'boxen';\nimport chalk from 'chalk';\nimport { CheckOptions, check } from '@strapi/pack-up';\n\nimport { runAction } from '../../utils/helpers';\nimport type { StrapiCommand, CLIContext } from '../../types';\n\ntype ActionOptions = CheckOptions;\n\nconst action = async (opts: ActionOptions, _cmd: unknown, { cwd, logger }: CLIContext) => {\n try {\n await check({\n cwd,\n ...opts,\n });\n } catch (err) {\n logger.error(\n 'There seems to be an unexpected error, try again with --debug for more information \\n'\n );\n if (err instanceof Error && err.stack) {\n console.log(\n chalk.red(\n boxen(err.stack, {\n padding: 1,\n align: 'left',\n })\n )\n );\n }\n process.exit(1);\n }\n};\n\n/**\n * `$ strapi plugin:verify`\n */\nconst command: StrapiCommand = ({ command, ctx }) => {\n command\n .command('plugin:verify')\n .description('Verify the output of your plugin before publishing it.')\n .option('-d, --debug', 'Enable debugging mode with verbose logs', false)\n .option('--silent', \"Don't log anything\", false)\n .action((...args) => runAction('plugin:verify', action)(...args, ctx));\n};\n\nexport { command };\n"],"names":["check","chalk","boxen","command","runAction"],"mappings":";;;;;;;;;AASA,MAAM,SAAS,OAAO,MAAqB,MAAe,EAAE,KAAK,aAAyB;AACpF,MAAA;AACF,UAAMA,aAAM;AAAA,MACV;AAAA,MACA,GAAG;AAAA,IAAA,CACJ;AAAA,WACM,KAAK;AACL,WAAA;AAAA,MACL;AAAA,IAAA;AAEE,QAAA,eAAe,SAAS,IAAI,OAAO;AAC7B,cAAA;AAAA,QACNC,eAAAA,QAAM;AAAA,UACJC,eAAA,QAAM,IAAI,OAAO;AAAA,YACf,SAAS;AAAA,YACT,OAAO;AAAA,UAAA,CACR;AAAA,QACH;AAAA,MAAA;AAAA,IAEJ;AACA,YAAQ,KAAK,CAAC;AAAA,EAChB;AACF;AAKA,MAAM,UAAyB,CAAC,EAAE,SAAAC,UAAS,UAAU;AACnDA,WACG,QAAQ,eAAe,EACvB,YAAY,wDAAwD,EACpE,OAAO,eAAe,2CAA2C,KAAK,EACtE,OAAO,YAAY,sBAAsB,KAAK,EAC9C,OAAO,IAAI,SAASC,QAAAA,UAAU,iBAAiB,MAAM,EAAE,GAAG,MAAM,GAAG,CAAC;AACzE;;"}
@@ -1,7 +0,0 @@
1
- import type { StrapiCommand } from '../../types';
2
- /**
3
- * `$ strapi plugin:watch`
4
- */
5
- declare const command: StrapiCommand;
6
- export { command };
7
- //# sourceMappingURL=watch.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"watch.d.ts","sourceRoot":"","sources":["../../../../src/cli/commands/plugin/watch.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,aAAa,EAAc,MAAM,aAAa,CAAC;AAwF7D;;GAEG;AACH,QAAA,MAAM,OAAO,EAAE,aAMd,CAAC;AAEF,OAAO,EAAE,OAAO,EAAE,CAAC"}