@strapi/strapi 5.8.1 → 5.10.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (293) hide show
  1. package/dist/admin-test.js +11 -8
  2. package/dist/admin-test.js.map +1 -1
  3. package/dist/admin-test.mjs +1 -1
  4. package/dist/admin-test.mjs.map +1 -1
  5. package/dist/admin.js +36 -42
  6. package/dist/admin.js.map +1 -1
  7. package/dist/admin.mjs +28 -35
  8. package/dist/admin.mjs.map +1 -1
  9. package/dist/chunks/aliases-Ca20Yntz.js +80 -0
  10. package/dist/chunks/aliases-Ca20Yntz.js.map +1 -0
  11. package/dist/chunks/aliases-DQ51KexN.mjs +76 -0
  12. package/dist/chunks/aliases-DQ51KexN.mjs.map +1 -0
  13. package/dist/chunks/build-3I6A92J1.js +59 -0
  14. package/dist/chunks/build-3I6A92J1.js.map +1 -0
  15. package/dist/chunks/build-BqigoS45.mjs +85 -0
  16. package/dist/chunks/build-BqigoS45.mjs.map +1 -0
  17. package/dist/chunks/build-CWUlYFQo.js +87 -0
  18. package/dist/chunks/build-CWUlYFQo.js.map +1 -0
  19. package/dist/chunks/build-gBR43Dth.mjs +57 -0
  20. package/dist/chunks/build-gBR43Dth.mjs.map +1 -0
  21. package/dist/chunks/config-5tFWkbOi.js +154 -0
  22. package/dist/chunks/config-5tFWkbOi.js.map +1 -0
  23. package/dist/chunks/config-BSlsDIVc.mjs +243 -0
  24. package/dist/chunks/config-BSlsDIVc.mjs.map +1 -0
  25. package/dist/chunks/config-CLeubzgx.mjs +150 -0
  26. package/dist/chunks/config-CLeubzgx.mjs.map +1 -0
  27. package/dist/chunks/config-CQ94iNYq.js +247 -0
  28. package/dist/chunks/config-CQ94iNYq.js.map +1 -0
  29. package/dist/chunks/index-DtHH3PFG.mjs +3160 -0
  30. package/dist/chunks/index-DtHH3PFG.mjs.map +1 -0
  31. package/dist/chunks/index-kv_K5f7_.js +3185 -0
  32. package/dist/chunks/index-kv_K5f7_.js.map +1 -0
  33. package/dist/chunks/watch-B7qfL21s.js +146 -0
  34. package/dist/chunks/watch-B7qfL21s.js.map +1 -0
  35. package/dist/chunks/watch-BBDpuCFC.js +133 -0
  36. package/dist/chunks/watch-BBDpuCFC.js.map +1 -0
  37. package/dist/chunks/watch-Bhd-75O5.mjs +131 -0
  38. package/dist/chunks/watch-Bhd-75O5.mjs.map +1 -0
  39. package/dist/chunks/watch-CJr1UoWF.mjs +144 -0
  40. package/dist/chunks/watch-CJr1UoWF.mjs.map +1 -0
  41. package/dist/cli/commands/plugin/init/files/typescript.d.ts +20 -7
  42. package/dist/cli/commands/plugin/init/files/typescript.d.ts.map +1 -1
  43. package/dist/cli/commands/version.d.ts.map +1 -1
  44. package/dist/cli/index.d.ts.map +1 -1
  45. package/dist/cli.js +50 -0
  46. package/dist/cli.js.map +1 -0
  47. package/dist/cli.mjs +43 -0
  48. package/dist/cli.mjs.map +1 -0
  49. package/dist/index.js +11 -8
  50. package/dist/index.js.map +1 -1
  51. package/dist/index.mjs +1 -1
  52. package/dist/index.mjs.map +1 -1
  53. package/dist/node/core/errors.d.ts.map +1 -1
  54. package/dist/node/create-build-context.d.ts +1 -1
  55. package/dist/node/create-build-context.d.ts.map +1 -1
  56. package/dist/node/vite/watch.d.ts.map +1 -1
  57. package/package.json +26 -26
  58. package/dist/cli/commands/admin/create-user.js +0 -91
  59. package/dist/cli/commands/admin/create-user.js.map +0 -1
  60. package/dist/cli/commands/admin/create-user.mjs +0 -88
  61. package/dist/cli/commands/admin/create-user.mjs.map +0 -1
  62. package/dist/cli/commands/admin/reset-user-password.js +0 -47
  63. package/dist/cli/commands/admin/reset-user-password.js.map +0 -1
  64. package/dist/cli/commands/admin/reset-user-password.mjs +0 -44
  65. package/dist/cli/commands/admin/reset-user-password.mjs.map +0 -1
  66. package/dist/cli/commands/build.js +0 -24
  67. package/dist/cli/commands/build.js.map +0 -1
  68. package/dist/cli/commands/build.mjs +0 -24
  69. package/dist/cli/commands/build.mjs.map +0 -1
  70. package/dist/cli/commands/components/list.js +0 -27
  71. package/dist/cli/commands/components/list.js.map +0 -1
  72. package/dist/cli/commands/components/list.mjs +0 -24
  73. package/dist/cli/commands/components/list.mjs.map +0 -1
  74. package/dist/cli/commands/configuration/dump.js +0 -43
  75. package/dist/cli/commands/configuration/dump.js.map +0 -1
  76. package/dist/cli/commands/configuration/dump.mjs +0 -41
  77. package/dist/cli/commands/configuration/dump.mjs.map +0 -1
  78. package/dist/cli/commands/configuration/restore.js +0 -142
  79. package/dist/cli/commands/configuration/restore.js.map +0 -1
  80. package/dist/cli/commands/configuration/restore.mjs +0 -139
  81. package/dist/cli/commands/configuration/restore.mjs.map +0 -1
  82. package/dist/cli/commands/console.js +0 -29
  83. package/dist/cli/commands/console.js.map +0 -1
  84. package/dist/cli/commands/console.mjs +0 -27
  85. package/dist/cli/commands/console.mjs.map +0 -1
  86. package/dist/cli/commands/content-types/list.js +0 -27
  87. package/dist/cli/commands/content-types/list.js.map +0 -1
  88. package/dist/cli/commands/content-types/list.mjs +0 -24
  89. package/dist/cli/commands/content-types/list.mjs.map +0 -1
  90. package/dist/cli/commands/controllers/list.js +0 -27
  91. package/dist/cli/commands/controllers/list.js.map +0 -1
  92. package/dist/cli/commands/controllers/list.mjs +0 -24
  93. package/dist/cli/commands/controllers/list.mjs.map +0 -1
  94. package/dist/cli/commands/develop.js +0 -29
  95. package/dist/cli/commands/develop.js.map +0 -1
  96. package/dist/cli/commands/develop.mjs +0 -27
  97. package/dist/cli/commands/develop.mjs.map +0 -1
  98. package/dist/cli/commands/export/action.js +0 -118
  99. package/dist/cli/commands/export/action.js.map +0 -1
  100. package/dist/cli/commands/export/action.mjs +0 -116
  101. package/dist/cli/commands/export/action.mjs.map +0 -1
  102. package/dist/cli/commands/export/command.js +0 -23
  103. package/dist/cli/commands/export/command.js.map +0 -1
  104. package/dist/cli/commands/export/command.mjs +0 -24
  105. package/dist/cli/commands/export/command.mjs.map +0 -1
  106. package/dist/cli/commands/generate.js +0 -35
  107. package/dist/cli/commands/generate.js.map +0 -1
  108. package/dist/cli/commands/generate.mjs +0 -13
  109. package/dist/cli/commands/generate.mjs.map +0 -1
  110. package/dist/cli/commands/hooks/list.js +0 -27
  111. package/dist/cli/commands/hooks/list.js.map +0 -1
  112. package/dist/cli/commands/hooks/list.mjs +0 -24
  113. package/dist/cli/commands/hooks/list.mjs.map +0 -1
  114. package/dist/cli/commands/import/action.js +0 -106
  115. package/dist/cli/commands/import/action.js.map +0 -1
  116. package/dist/cli/commands/import/action.mjs +0 -105
  117. package/dist/cli/commands/import/action.mjs.map +0 -1
  118. package/dist/cli/commands/import/command.js +0 -70
  119. package/dist/cli/commands/import/command.js.map +0 -1
  120. package/dist/cli/commands/import/command.mjs +0 -68
  121. package/dist/cli/commands/import/command.mjs.map +0 -1
  122. package/dist/cli/commands/index.js +0 -63
  123. package/dist/cli/commands/index.js.map +0 -1
  124. package/dist/cli/commands/index.mjs +0 -63
  125. package/dist/cli/commands/index.mjs.map +0 -1
  126. package/dist/cli/commands/middlewares/list.js +0 -27
  127. package/dist/cli/commands/middlewares/list.js.map +0 -1
  128. package/dist/cli/commands/middlewares/list.mjs +0 -24
  129. package/dist/cli/commands/middlewares/list.mjs.map +0 -1
  130. package/dist/cli/commands/policies/list.js +0 -27
  131. package/dist/cli/commands/policies/list.js.map +0 -1
  132. package/dist/cli/commands/policies/list.mjs +0 -24
  133. package/dist/cli/commands/policies/list.mjs.map +0 -1
  134. package/dist/cli/commands/report.js +0 -35
  135. package/dist/cli/commands/report.js.map +0 -1
  136. package/dist/cli/commands/report.mjs +0 -35
  137. package/dist/cli/commands/report.mjs.map +0 -1
  138. package/dist/cli/commands/routes/list.js +0 -31
  139. package/dist/cli/commands/routes/list.js.map +0 -1
  140. package/dist/cli/commands/routes/list.mjs +0 -28
  141. package/dist/cli/commands/routes/list.mjs.map +0 -1
  142. package/dist/cli/commands/services/list.js +0 -27
  143. package/dist/cli/commands/services/list.js.map +0 -1
  144. package/dist/cli/commands/services/list.mjs +0 -24
  145. package/dist/cli/commands/services/list.mjs.map +0 -1
  146. package/dist/cli/commands/start.js +0 -27
  147. package/dist/cli/commands/start.js.map +0 -1
  148. package/dist/cli/commands/start.mjs +0 -24
  149. package/dist/cli/commands/start.mjs.map +0 -1
  150. package/dist/cli/commands/telemetry/disable.js +0 -70
  151. package/dist/cli/commands/telemetry/disable.js.map +0 -1
  152. package/dist/cli/commands/telemetry/disable.mjs +0 -67
  153. package/dist/cli/commands/telemetry/disable.mjs.map +0 -1
  154. package/dist/cli/commands/telemetry/enable.js +0 -89
  155. package/dist/cli/commands/telemetry/enable.js.map +0 -1
  156. package/dist/cli/commands/telemetry/enable.mjs +0 -86
  157. package/dist/cli/commands/telemetry/enable.mjs.map +0 -1
  158. package/dist/cli/commands/templates/generate.js +0 -11
  159. package/dist/cli/commands/templates/generate.js.map +0 -1
  160. package/dist/cli/commands/templates/generate.mjs +0 -11
  161. package/dist/cli/commands/templates/generate.mjs.map +0 -1
  162. package/dist/cli/commands/transfer/action.js +0 -130
  163. package/dist/cli/commands/transfer/action.js.map +0 -1
  164. package/dist/cli/commands/transfer/action.mjs +0 -131
  165. package/dist/cli/commands/transfer/action.mjs.map +0 -1
  166. package/dist/cli/commands/transfer/command.js +0 -85
  167. package/dist/cli/commands/transfer/command.js.map +0 -1
  168. package/dist/cli/commands/transfer/command.mjs +0 -84
  169. package/dist/cli/commands/transfer/command.mjs.map +0 -1
  170. package/dist/cli/commands/ts/generate-types.js +0 -36
  171. package/dist/cli/commands/ts/generate-types.js.map +0 -1
  172. package/dist/cli/commands/ts/generate-types.mjs +0 -34
  173. package/dist/cli/commands/ts/generate-types.mjs.map +0 -1
  174. package/dist/cli/commands/version.js +0 -13
  175. package/dist/cli/commands/version.js.map +0 -1
  176. package/dist/cli/commands/version.mjs +0 -13
  177. package/dist/cli/commands/version.mjs.map +0 -1
  178. package/dist/cli/index.js +0 -79
  179. package/dist/cli/index.js.map +0 -1
  180. package/dist/cli/index.mjs +0 -79
  181. package/dist/cli/index.mjs.map +0 -1
  182. package/dist/cli/utils/commander.js +0 -111
  183. package/dist/cli/utils/commander.js.map +0 -1
  184. package/dist/cli/utils/commander.mjs +0 -108
  185. package/dist/cli/utils/commander.mjs.map +0 -1
  186. package/dist/cli/utils/data-transfer.js +0 -354
  187. package/dist/cli/utils/data-transfer.js.map +0 -1
  188. package/dist/cli/utils/data-transfer.mjs +0 -350
  189. package/dist/cli/utils/data-transfer.mjs.map +0 -1
  190. package/dist/cli/utils/helpers.js +0 -102
  191. package/dist/cli/utils/helpers.js.map +0 -1
  192. package/dist/cli/utils/helpers.mjs +0 -100
  193. package/dist/cli/utils/helpers.mjs.map +0 -1
  194. package/dist/cli/utils/logger.js +0 -137
  195. package/dist/cli/utils/logger.js.map +0 -1
  196. package/dist/cli/utils/logger.mjs +0 -116
  197. package/dist/cli/utils/logger.mjs.map +0 -1
  198. package/dist/cli/utils/telemetry.js +0 -22
  199. package/dist/cli/utils/telemetry.js.map +0 -1
  200. package/dist/cli/utils/telemetry.mjs +0 -22
  201. package/dist/cli/utils/telemetry.mjs.map +0 -1
  202. package/dist/cli/utils/tsconfig.js +0 -26
  203. package/dist/cli/utils/tsconfig.js.map +0 -1
  204. package/dist/cli/utils/tsconfig.mjs +0 -23
  205. package/dist/cli/utils/tsconfig.mjs.map +0 -1
  206. package/dist/node/build.js +0 -76
  207. package/dist/node/build.js.map +0 -1
  208. package/dist/node/build.mjs +0 -58
  209. package/dist/node/build.mjs.map +0 -1
  210. package/dist/node/core/admin-customisations.js +0 -24
  211. package/dist/node/core/admin-customisations.js.map +0 -1
  212. package/dist/node/core/admin-customisations.mjs +0 -22
  213. package/dist/node/core/admin-customisations.mjs.map +0 -1
  214. package/dist/node/core/aliases.js +0 -33
  215. package/dist/node/core/aliases.js.map +0 -1
  216. package/dist/node/core/aliases.mjs +0 -31
  217. package/dist/node/core/aliases.mjs.map +0 -1
  218. package/dist/node/core/config.js +0 -18
  219. package/dist/node/core/config.js.map +0 -1
  220. package/dist/node/core/config.mjs +0 -16
  221. package/dist/node/core/config.mjs.map +0 -1
  222. package/dist/node/core/dependencies.js +0 -163
  223. package/dist/node/core/dependencies.js.map +0 -1
  224. package/dist/node/core/dependencies.mjs +0 -155
  225. package/dist/node/core/dependencies.mjs.map +0 -1
  226. package/dist/node/core/env.js +0 -26
  227. package/dist/node/core/env.js.map +0 -1
  228. package/dist/node/core/env.mjs +0 -23
  229. package/dist/node/core/env.mjs.map +0 -1
  230. package/dist/node/core/errors.js +0 -33
  231. package/dist/node/core/errors.js.map +0 -1
  232. package/dist/node/core/errors.mjs +0 -29
  233. package/dist/node/core/errors.mjs.map +0 -1
  234. package/dist/node/core/files.js +0 -45
  235. package/dist/node/core/files.js.map +0 -1
  236. package/dist/node/core/files.mjs +0 -43
  237. package/dist/node/core/files.mjs.map +0 -1
  238. package/dist/node/core/managers.js +0 -17
  239. package/dist/node/core/managers.js.map +0 -1
  240. package/dist/node/core/managers.mjs +0 -17
  241. package/dist/node/core/managers.mjs.map +0 -1
  242. package/dist/node/core/monorepo.js +0 -23
  243. package/dist/node/core/monorepo.js.map +0 -1
  244. package/dist/node/core/monorepo.mjs +0 -20
  245. package/dist/node/core/monorepo.mjs.map +0 -1
  246. package/dist/node/core/plugins.js +0 -116
  247. package/dist/node/core/plugins.js.map +0 -1
  248. package/dist/node/core/plugins.mjs +0 -111
  249. package/dist/node/core/plugins.mjs.map +0 -1
  250. package/dist/node/core/timer.js +0 -27
  251. package/dist/node/core/timer.js.map +0 -1
  252. package/dist/node/core/timer.mjs +0 -27
  253. package/dist/node/core/timer.mjs.map +0 -1
  254. package/dist/node/create-build-context.js +0 -101
  255. package/dist/node/create-build-context.js.map +0 -1
  256. package/dist/node/create-build-context.mjs +0 -96
  257. package/dist/node/create-build-context.mjs.map +0 -1
  258. package/dist/node/develop.js +0 -275
  259. package/dist/node/develop.js.map +0 -1
  260. package/dist/node/develop.mjs +0 -252
  261. package/dist/node/develop.mjs.map +0 -1
  262. package/dist/node/staticFiles.js +0 -102
  263. package/dist/node/staticFiles.js.map +0 -1
  264. package/dist/node/staticFiles.mjs +0 -76
  265. package/dist/node/staticFiles.mjs.map +0 -1
  266. package/dist/node/vite/build.js +0 -34
  267. package/dist/node/vite/build.js.map +0 -1
  268. package/dist/node/vite/build.mjs +0 -12
  269. package/dist/node/vite/build.mjs.map +0 -1
  270. package/dist/node/vite/config.js +0 -106
  271. package/dist/node/vite/config.js.map +0 -1
  272. package/dist/node/vite/config.mjs +0 -103
  273. package/dist/node/vite/config.mjs.map +0 -1
  274. package/dist/node/vite/plugins.js +0 -43
  275. package/dist/node/vite/plugins.js.map +0 -1
  276. package/dist/node/vite/plugins.mjs +0 -43
  277. package/dist/node/vite/plugins.mjs.map +0 -1
  278. package/dist/node/vite/watch.js +0 -103
  279. package/dist/node/vite/watch.js.map +0 -1
  280. package/dist/node/vite/watch.mjs +0 -77
  281. package/dist/node/vite/watch.mjs.map +0 -1
  282. package/dist/node/webpack/build.js +0 -41
  283. package/dist/node/webpack/build.js.map +0 -1
  284. package/dist/node/webpack/build.mjs +0 -39
  285. package/dist/node/webpack/build.mjs.map +0 -1
  286. package/dist/node/webpack/config.js +0 -259
  287. package/dist/node/webpack/config.js.map +0 -1
  288. package/dist/node/webpack/config.mjs +0 -228
  289. package/dist/node/webpack/config.mjs.map +0 -1
  290. package/dist/node/webpack/watch.js +0 -95
  291. package/dist/node/webpack/watch.js.map +0 -1
  292. package/dist/node/webpack/watch.mjs +0 -90
  293. package/dist/node/webpack/watch.mjs.map +0 -1
@@ -1,36 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
- const commander = require("commander");
4
- const tsUtils = require("@strapi/typescript-utils");
5
- const core = require("@strapi/core");
6
- const helpers = require("../../utils/helpers.js");
7
- const _interopDefault = (e) => e && e.__esModule ? e : { default: e };
8
- const tsUtils__default = /* @__PURE__ */ _interopDefault(tsUtils);
9
- const action = async ({ debug, silent, verbose, outDir }) => {
10
- if ((debug || verbose) && silent) {
11
- console.error("Flags conflict: both silent and debug mode are enabled, exiting...");
12
- process.exit(1);
13
- }
14
- const appContext = await core.compileStrapi({ ignoreDiagnostics: true });
15
- const app = await core.createStrapi(appContext).register();
16
- await tsUtils__default.default.generators.generate({
17
- strapi: app,
18
- pwd: appContext.appDir,
19
- rootDir: outDir ?? void 0,
20
- logger: {
21
- silent,
22
- debug
23
- },
24
- artifacts: { contentTypes: true, components: true }
25
- });
26
- await app.destroy();
27
- };
28
- const command = () => {
29
- return commander.createCommand("ts:generate-types").description(`Generate TypeScript typings for your schemas`).option("-d, --debug", `Run the generation with debug messages`, false).option("-s, --silent", `Run the generation silently, without any output`, false).option(
30
- "-o, --out-dir <outDir>",
31
- "Specify a relative root directory in which the definitions will be generated. Changing this value might break types exposed by Strapi that relies on generated types."
32
- ).action(helpers.runAction("ts:generate-types", action));
33
- };
34
- exports.action = action;
35
- exports.command = command;
36
- //# sourceMappingURL=generate-types.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"generate-types.js","sources":["../../../../src/cli/commands/ts/generate-types.ts"],"sourcesContent":["import { createCommand } from 'commander';\nimport tsUtils from '@strapi/typescript-utils';\nimport { createStrapi, compileStrapi } from '@strapi/core';\n\nimport type { StrapiCommand } from '../../types';\nimport { runAction } from '../../utils/helpers';\n\ninterface CmdOptions {\n debug?: boolean;\n silent?: boolean;\n verbose?: boolean;\n outDir?: string;\n}\n\nconst action = async ({ debug, silent, verbose, outDir }: CmdOptions) => {\n if ((debug || verbose) && silent) {\n console.error('Flags conflict: both silent and debug mode are enabled, exiting...');\n process.exit(1);\n }\n\n const appContext = await compileStrapi({ ignoreDiagnostics: true });\n const app = await createStrapi(appContext).register();\n\n await tsUtils.generators.generate({\n strapi: app,\n pwd: appContext.appDir,\n rootDir: outDir ?? undefined,\n logger: {\n silent,\n debug,\n },\n artifacts: { contentTypes: true, components: true },\n });\n\n await app.destroy();\n};\n\n/**\n * `$ strapi ts:generate-types`\n */\nconst command: StrapiCommand = () => {\n return createCommand('ts:generate-types')\n .description(`Generate TypeScript typings for your schemas`)\n .option('-d, --debug', `Run the generation with debug messages`, false)\n .option('-s, --silent', `Run the generation silently, without any output`, false)\n .option(\n '-o, --out-dir <outDir>',\n 'Specify a relative root directory in which the definitions will be generated. Changing this value might break types exposed by Strapi that relies on generated types.'\n )\n .action(runAction('ts:generate-types', action));\n};\n\nexport { action, command };\n"],"names":["compileStrapi","createStrapi","tsUtils","createCommand","runAction"],"mappings":";;;;;;;;AAcA,MAAM,SAAS,OAAO,EAAE,OAAO,QAAQ,SAAS,aAAyB;AAClE,OAAA,SAAS,YAAY,QAAQ;AAChC,YAAQ,MAAM,oEAAoE;AAClF,YAAQ,KAAK,CAAC;AAAA,EAAA;AAGhB,QAAM,aAAa,MAAMA,KAAAA,cAAc,EAAE,mBAAmB,MAAM;AAClE,QAAM,MAAM,MAAMC,KAAAA,aAAa,UAAU,EAAE,SAAS;AAE9C,QAAAC,iBAAA,QAAQ,WAAW,SAAS;AAAA,IAChC,QAAQ;AAAA,IACR,KAAK,WAAW;AAAA,IAChB,SAAS,UAAU;AAAA,IACnB,QAAQ;AAAA,MACN;AAAA,MACA;AAAA,IACF;AAAA,IACA,WAAW,EAAE,cAAc,MAAM,YAAY,KAAK;AAAA,EAAA,CACnD;AAED,QAAM,IAAI,QAAQ;AACpB;AAKA,MAAM,UAAyB,MAAM;AACnC,SAAOC,UAAAA,cAAc,mBAAmB,EACrC,YAAY,8CAA8C,EAC1D,OAAO,eAAe,0CAA0C,KAAK,EACrE,OAAO,gBAAgB,mDAAmD,KAAK,EAC/E;AAAA,IACC;AAAA,IACA;AAAA,EAED,EAAA,OAAOC,QAAAA,UAAU,qBAAqB,MAAM,CAAC;AAClD;;;"}
@@ -1,34 +0,0 @@
1
- import { createCommand } from "commander";
2
- import tsUtils__default from "@strapi/typescript-utils";
3
- import { compileStrapi, createStrapi } from "@strapi/core";
4
- import { runAction } from "../../utils/helpers.mjs";
5
- const action = async ({ debug, silent, verbose, outDir }) => {
6
- if ((debug || verbose) && silent) {
7
- console.error("Flags conflict: both silent and debug mode are enabled, exiting...");
8
- process.exit(1);
9
- }
10
- const appContext = await compileStrapi({ ignoreDiagnostics: true });
11
- const app = await createStrapi(appContext).register();
12
- await tsUtils__default.generators.generate({
13
- strapi: app,
14
- pwd: appContext.appDir,
15
- rootDir: outDir ?? void 0,
16
- logger: {
17
- silent,
18
- debug
19
- },
20
- artifacts: { contentTypes: true, components: true }
21
- });
22
- await app.destroy();
23
- };
24
- const command = () => {
25
- return createCommand("ts:generate-types").description(`Generate TypeScript typings for your schemas`).option("-d, --debug", `Run the generation with debug messages`, false).option("-s, --silent", `Run the generation silently, without any output`, false).option(
26
- "-o, --out-dir <outDir>",
27
- "Specify a relative root directory in which the definitions will be generated. Changing this value might break types exposed by Strapi that relies on generated types."
28
- ).action(runAction("ts:generate-types", action));
29
- };
30
- export {
31
- action,
32
- command
33
- };
34
- //# sourceMappingURL=generate-types.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"generate-types.mjs","sources":["../../../../src/cli/commands/ts/generate-types.ts"],"sourcesContent":["import { createCommand } from 'commander';\nimport tsUtils from '@strapi/typescript-utils';\nimport { createStrapi, compileStrapi } from '@strapi/core';\n\nimport type { StrapiCommand } from '../../types';\nimport { runAction } from '../../utils/helpers';\n\ninterface CmdOptions {\n debug?: boolean;\n silent?: boolean;\n verbose?: boolean;\n outDir?: string;\n}\n\nconst action = async ({ debug, silent, verbose, outDir }: CmdOptions) => {\n if ((debug || verbose) && silent) {\n console.error('Flags conflict: both silent and debug mode are enabled, exiting...');\n process.exit(1);\n }\n\n const appContext = await compileStrapi({ ignoreDiagnostics: true });\n const app = await createStrapi(appContext).register();\n\n await tsUtils.generators.generate({\n strapi: app,\n pwd: appContext.appDir,\n rootDir: outDir ?? undefined,\n logger: {\n silent,\n debug,\n },\n artifacts: { contentTypes: true, components: true },\n });\n\n await app.destroy();\n};\n\n/**\n * `$ strapi ts:generate-types`\n */\nconst command: StrapiCommand = () => {\n return createCommand('ts:generate-types')\n .description(`Generate TypeScript typings for your schemas`)\n .option('-d, --debug', `Run the generation with debug messages`, false)\n .option('-s, --silent', `Run the generation silently, without any output`, false)\n .option(\n '-o, --out-dir <outDir>',\n 'Specify a relative root directory in which the definitions will be generated. Changing this value might break types exposed by Strapi that relies on generated types.'\n )\n .action(runAction('ts:generate-types', action));\n};\n\nexport { action, command };\n"],"names":["tsUtils"],"mappings":";;;;AAcA,MAAM,SAAS,OAAO,EAAE,OAAO,QAAQ,SAAS,aAAyB;AAClE,OAAA,SAAS,YAAY,QAAQ;AAChC,YAAQ,MAAM,oEAAoE;AAClF,YAAQ,KAAK,CAAC;AAAA,EAAA;AAGhB,QAAM,aAAa,MAAM,cAAc,EAAE,mBAAmB,MAAM;AAClE,QAAM,MAAM,MAAM,aAAa,UAAU,EAAE,SAAS;AAE9C,QAAAA,iBAAQ,WAAW,SAAS;AAAA,IAChC,QAAQ;AAAA,IACR,KAAK,WAAW;AAAA,IAChB,SAAS,UAAU;AAAA,IACnB,QAAQ;AAAA,MACN;AAAA,MACA;AAAA,IACF;AAAA,IACA,WAAW,EAAE,cAAc,MAAM,YAAY,KAAK;AAAA,EAAA,CACnD;AAED,QAAM,IAAI,QAAQ;AACpB;AAKA,MAAM,UAAyB,MAAM;AACnC,SAAO,cAAc,mBAAmB,EACrC,YAAY,8CAA8C,EAC1D,OAAO,eAAe,0CAA0C,KAAK,EACrE,OAAO,gBAAgB,mDAAmD,KAAK,EAC/E;AAAA,IACC;AAAA,IACA;AAAA,EAED,EAAA,OAAO,UAAU,qBAAqB,MAAM,CAAC;AAClD;"}
@@ -1,13 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
- const commander = require("commander");
4
- const command = () => {
5
- return commander.createCommand("version").description("Output the version of Strapi").action(() => {
6
- const { version } = require("../../../package.json");
7
- process.stdout.write(`${version}
8
- `);
9
- process.exit(0);
10
- });
11
- };
12
- exports.command = command;
13
- //# sourceMappingURL=version.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"version.js","sources":["../../../src/cli/commands/version.ts"],"sourcesContent":["import { createCommand } from 'commander';\nimport type { StrapiCommand } from '../types';\n\n/**\n * `$ strapi version`\n */\n\nconst command: StrapiCommand = () => {\n // load the Strapi package.json to get version and other information\n return createCommand('version')\n .description('Output the version of Strapi')\n .action(() => {\n // eslint-disable-next-line @typescript-eslint/no-var-requires\n const { version } = require('../../../package.json');\n\n process.stdout.write(`${version}\\n`);\n process.exit(0);\n });\n};\n\nexport { command };\n"],"names":["createCommand"],"mappings":";;;AAOA,MAAM,UAAyB,MAAM;AAEnC,SAAOA,UAAAA,cAAc,SAAS,EAC3B,YAAY,8BAA8B,EAC1C,OAAO,MAAM;AAEZ,UAAM,EAAE,QAAA,IAAY,QAAQ,uBAAuB;AAE3C,YAAA,OAAO,MAAM,GAAG,OAAO;AAAA,CAAI;AACnC,YAAQ,KAAK,CAAC;AAAA,EAAA,CACf;AACL;;"}
@@ -1,13 +0,0 @@
1
- import { createCommand } from "commander";
2
- const command = () => {
3
- return createCommand("version").description("Output the version of Strapi").action(() => {
4
- const { version } = require("../../../package.json");
5
- process.stdout.write(`${version}
6
- `);
7
- process.exit(0);
8
- });
9
- };
10
- export {
11
- command
12
- };
13
- //# sourceMappingURL=version.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"version.mjs","sources":["../../../src/cli/commands/version.ts"],"sourcesContent":["import { createCommand } from 'commander';\nimport type { StrapiCommand } from '../types';\n\n/**\n * `$ strapi version`\n */\n\nconst command: StrapiCommand = () => {\n // load the Strapi package.json to get version and other information\n return createCommand('version')\n .description('Output the version of Strapi')\n .action(() => {\n // eslint-disable-next-line @typescript-eslint/no-var-requires\n const { version } = require('../../../package.json');\n\n process.stdout.write(`${version}\\n`);\n process.exit(0);\n });\n};\n\nexport { command };\n"],"names":[],"mappings":";AAOA,MAAM,UAAyB,MAAM;AAEnC,SAAO,cAAc,SAAS,EAC3B,YAAY,8BAA8B,EAC1C,OAAO,MAAM;AAEZ,UAAM,EAAE,QAAA,IAAY,QAAQ,uBAAuB;AAE3C,YAAA,OAAO,MAAM,GAAG,OAAO;AAAA,CAAI;AACnC,YAAQ,KAAK,CAAC;AAAA,EAAA,CACf;AACL;"}
package/dist/cli/index.js DELETED
@@ -1,79 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
- const commander = require("commander");
4
- const index = require("./commands/index.js");
5
- const logger = require("./utils/logger.js");
6
- const tsconfig = require("./utils/tsconfig.js");
7
- const createCLI = async (argv, command = new commander.Command()) => {
8
- command.storeOptionsAsProperties(false).allowUnknownOption(true);
9
- command.helpOption("-h, --help", "Display help for command");
10
- command.addHelpCommand("help [command]", "Display help for command");
11
- command.version(
12
- // eslint-disable-next-line @typescript-eslint/no-var-requires
13
- require("../../package.json").version,
14
- "-v, --version",
15
- "Output the version number"
16
- );
17
- const cwd = process.cwd();
18
- const hasDebug = argv.includes("--debug");
19
- const hasSilent = argv.includes("--silent");
20
- const logger$1 = logger.createLogger({ debug: hasDebug, silent: hasSilent, timestamp: false });
21
- const tsconfig$1 = tsconfig.loadTsConfig({
22
- cwd,
23
- path: "tsconfig.json",
24
- logger: logger$1
25
- });
26
- const ctx = {
27
- cwd,
28
- logger: logger$1,
29
- tsconfig: tsconfig$1
30
- };
31
- for (const commandFactory of index.commands) {
32
- try {
33
- const subCommand = await commandFactory({ command, argv, ctx });
34
- if (subCommand) {
35
- command.addCommand(subCommand);
36
- }
37
- } catch (e) {
38
- console.error(`Failed to load command`, e);
39
- }
40
- }
41
- const deprecatedCommands = [
42
- { name: "plugin:init", message: "Please use `npx @strapi/sdk-plugin init` instead." },
43
- {
44
- name: "plugin:verify",
45
- message: "After migrating your plugin to v5, use `strapi-plugin verify`"
46
- },
47
- {
48
- name: "plugin:watch",
49
- message: "After migrating your plugin to v5, use `strapi-plugin watch`"
50
- },
51
- {
52
- name: "plugin:watch:link",
53
- message: "After migrating your plugin to v5, use `strapi-plugin watch:link`"
54
- },
55
- {
56
- name: "plugin:build",
57
- message: "After migrating your plugin to v5, use `strapi-plugin build`"
58
- }
59
- ];
60
- deprecatedCommands.forEach(({ name, message }) => {
61
- const deprecated = new commander.Command(name).command(name).description("(deprecated)").action(() => {
62
- console.warn(
63
- `The command ${name} has been deprecated. See the Strapi 5 migration guide for more information.`
64
- );
65
- if (message) {
66
- console.warn(message);
67
- }
68
- });
69
- command.addCommand(deprecated, { hidden: true });
70
- });
71
- return command;
72
- };
73
- const runCLI = async (argv = process.argv, command = new commander.Command()) => {
74
- const commands = await createCLI(argv, command);
75
- await commands.parseAsync(argv);
76
- };
77
- exports.createCLI = createCLI;
78
- exports.runCLI = runCLI;
79
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sources":["../../src/cli/index.ts"],"sourcesContent":["import { Command } from 'commander';\n\nimport { commands as strapiCommands } from './commands';\n\nimport { createLogger } from './utils/logger';\nimport { loadTsConfig } from './utils/tsconfig';\nimport { CLIContext } from './types';\n\nconst createCLI = async (argv: string[], command = new Command()) => {\n // Initial program setup\n command.storeOptionsAsProperties(false).allowUnknownOption(true);\n\n // Help command\n command.helpOption('-h, --help', 'Display help for command');\n command.addHelpCommand('help [command]', 'Display help for command');\n\n command.version(\n // eslint-disable-next-line @typescript-eslint/no-var-requires\n require('../../package.json').version,\n '-v, --version',\n 'Output the version number'\n );\n\n const cwd = process.cwd();\n\n const hasDebug = argv.includes('--debug');\n const hasSilent = argv.includes('--silent');\n\n const logger = createLogger({ debug: hasDebug, silent: hasSilent, timestamp: false });\n\n const tsconfig = loadTsConfig({\n cwd,\n path: 'tsconfig.json',\n logger,\n });\n\n const ctx = {\n cwd,\n logger,\n tsconfig,\n } satisfies CLIContext;\n\n // Load all commands\n for (const commandFactory of strapiCommands) {\n try {\n const subCommand = await commandFactory({ command, argv, ctx });\n\n // Add this command to the Commander command object\n if (subCommand) {\n command.addCommand(subCommand);\n }\n } catch (e) {\n console.error(`Failed to load command`, e);\n }\n }\n\n // TODO v6: remove these deprecation notices\n const deprecatedCommands = [\n { name: 'plugin:init', message: 'Please use `npx @strapi/sdk-plugin init` instead.' },\n {\n name: 'plugin:verify',\n message: 'After migrating your plugin to v5, use `strapi-plugin verify`',\n },\n {\n name: 'plugin:watch',\n message: 'After migrating your plugin to v5, use `strapi-plugin watch`',\n },\n {\n name: 'plugin:watch:link',\n message: 'After migrating your plugin to v5, use `strapi-plugin watch:link`',\n },\n {\n name: 'plugin:build',\n message: 'After migrating your plugin to v5, use `strapi-plugin build`',\n },\n ];\n\n // Add hidden commands for deprecatedCommands that output a warning that the command has been removed.\n deprecatedCommands.forEach(({ name, message }) => {\n const deprecated = new Command(name)\n .command(name)\n .description('(deprecated)')\n .action(() => {\n console.warn(\n `The command ${name} has been deprecated. See the Strapi 5 migration guide for more information.`\n );\n if (message) {\n console.warn(message);\n }\n });\n command.addCommand(deprecated, { hidden: true });\n });\n return command;\n};\n\nconst runCLI = async (argv = process.argv, command = new Command()) => {\n const commands = await createCLI(argv, command);\n await commands.parseAsync(argv);\n};\n\nexport { runCLI, createCLI };\n"],"names":["Command","logger","createLogger","tsconfig","loadTsConfig","strapiCommands"],"mappings":";;;;;;AAQA,MAAM,YAAY,OAAO,MAAgB,UAAU,IAAIA,wBAAc;AAEnE,UAAQ,yBAAyB,KAAK,EAAE,mBAAmB,IAAI;AAGvD,UAAA,WAAW,cAAc,0BAA0B;AACnD,UAAA,eAAe,kBAAkB,0BAA0B;AAE3D,UAAA;AAAA;AAAA,IAEN,QAAQ,oBAAoB,EAAE;AAAA,IAC9B;AAAA,IACA;AAAA,EACF;AAEM,QAAA,MAAM,QAAQ,IAAI;AAElB,QAAA,WAAW,KAAK,SAAS,SAAS;AAClC,QAAA,YAAY,KAAK,SAAS,UAAU;AAEpC,QAAAC,WAASC,oBAAa,EAAE,OAAO,UAAU,QA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0,0 @@
1
- import { Command } from "commander";
2
- import { commands } from "./commands/index.mjs";
3
- import { createLogger } from "./utils/logger.mjs";
4
- import { loadTsConfig } from "./utils/tsconfig.mjs";
5
- const createCLI = async (argv, command = new Command()) => {
6
- command.storeOptionsAsProperties(false).allowUnknownOption(true);
7
- command.helpOption("-h, --help", "Display help for command");
8
- command.addHelpCommand("help [command]", "Display help for command");
9
- command.version(
10
- // eslint-disable-next-line @typescript-eslint/no-var-requires
11
- require("../../package.json").version,
12
- "-v, --version",
13
- "Output the version number"
14
- );
15
- const cwd = process.cwd();
16
- const hasDebug = argv.includes("--debug");
17
- const hasSilent = argv.includes("--silent");
18
- const logger = createLogger({ debug: hasDebug, silent: hasSilent, timestamp: false });
19
- const tsconfig = loadTsConfig({
20
- cwd,
21
- path: "tsconfig.json",
22
- logger
23
- });
24
- const ctx = {
25
- cwd,
26
- logger,
27
- tsconfig
28
- };
29
- for (const commandFactory of commands) {
30
- try {
31
- const subCommand = await commandFactory({ command, argv, ctx });
32
- if (subCommand) {
33
- command.addCommand(subCommand);
34
- }
35
- } catch (e) {
36
- console.error(`Failed to load command`, e);
37
- }
38
- }
39
- const deprecatedCommands = [
40
- { name: "plugin:init", message: "Please use `npx @strapi/sdk-plugin init` instead." },
41
- {
42
- name: "plugin:verify",
43
- message: "After migrating your plugin to v5, use `strapi-plugin verify`"
44
- },
45
- {
46
- name: "plugin:watch",
47
- message: "After migrating your plugin to v5, use `strapi-plugin watch`"
48
- },
49
- {
50
- name: "plugin:watch:link",
51
- message: "After migrating your plugin to v5, use `strapi-plugin watch:link`"
52
- },
53
- {
54
- name: "plugin:build",
55
- message: "After migrating your plugin to v5, use `strapi-plugin build`"
56
- }
57
- ];
58
- deprecatedCommands.forEach(({ name, message }) => {
59
- const deprecated = new Command(name).command(name).description("(deprecated)").action(() => {
60
- console.warn(
61
- `The command ${name} has been deprecated. See the Strapi 5 migration guide for more information.`
62
- );
63
- if (message) {
64
- console.warn(message);
65
- }
66
- });
67
- command.addCommand(deprecated, { hidden: true });
68
- });
69
- return command;
70
- };
71
- const runCLI = async (argv = process.argv, command = new Command()) => {
72
- const commands2 = await createCLI(argv, command);
73
- await commands2.parseAsync(argv);
74
- };
75
- export {
76
- createCLI,
77
- runCLI
78
- };
79
- //# sourceMappingURL=index.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.mjs","sources":["../../src/cli/index.ts"],"sourcesContent":["import { Command } from 'commander';\n\nimport { commands as strapiCommands } from './commands';\n\nimport { createLogger } from './utils/logger';\nimport { loadTsConfig } from './utils/tsconfig';\nimport { CLIContext } from './types';\n\nconst createCLI = async (argv: string[], command = new Command()) => {\n // Initial program setup\n command.storeOptionsAsProperties(false).allowUnknownOption(true);\n\n // Help command\n command.helpOption('-h, --help', 'Display help for command');\n command.addHelpCommand('help [command]', 'Display help for command');\n\n command.version(\n // eslint-disable-next-line @typescript-eslint/no-var-requires\n require('../../package.json').version,\n '-v, --version',\n 'Output the version number'\n );\n\n const cwd = process.cwd();\n\n const hasDebug = argv.includes('--debug');\n const hasSilent = argv.includes('--silent');\n\n const logger = createLogger({ debug: hasDebug, silent: hasSilent, timestamp: false });\n\n const tsconfig = loadTsConfig({\n cwd,\n path: 'tsconfig.json',\n logger,\n });\n\n const ctx = {\n cwd,\n logger,\n tsconfig,\n } satisfies CLIContext;\n\n // Load all commands\n for (const commandFactory of strapiCommands) {\n try {\n const subCommand = await commandFactory({ command, argv, ctx });\n\n // Add this command to the Commander command object\n if (subCommand) {\n command.addCommand(subCommand);\n }\n } catch (e) {\n console.error(`Failed to load command`, e);\n }\n }\n\n // TODO v6: remove these deprecation notices\n const deprecatedCommands = [\n { name: 'plugin:init', message: 'Please use `npx @strapi/sdk-plugin init` instead.' },\n {\n name: 'plugin:verify',\n message: 'After migrating your plugin to v5, use `strapi-plugin verify`',\n },\n {\n name: 'plugin:watch',\n message: 'After migrating your plugin to v5, use `strapi-plugin watch`',\n },\n {\n name: 'plugin:watch:link',\n message: 'After migrating your plugin to v5, use `strapi-plugin watch:link`',\n },\n {\n name: 'plugin:build',\n message: 'After migrating your plugin to v5, use `strapi-plugin build`',\n },\n ];\n\n // Add hidden commands for deprecatedCommands that output a warning that the command has been removed.\n deprecatedCommands.forEach(({ name, message }) => {\n const deprecated = new Command(name)\n .command(name)\n .description('(deprecated)')\n .action(() => {\n console.warn(\n `The command ${name} has been deprecated. See the Strapi 5 migration guide for more information.`\n );\n if (message) {\n console.warn(message);\n }\n });\n command.addCommand(deprecated, { hidden: true });\n });\n return command;\n};\n\nconst runCLI = async (argv = process.argv, command = new Command()) => {\n const commands = await createCLI(argv, command);\n await commands.parseAsync(argv);\n};\n\nexport { runCLI, createCLI };\n"],"names":["strapiCommands","commands"],"mappings":";;;;AAQA,MAAM,YAAY,OAAO,MAAgB,UAAU,IAAI,cAAc;AAEnE,UAAQ,yBAAyB,KAAK,EAAE,mBAAmB,IAAI;AAGvD,UAAA,WAAW,cAAc,0BAA0B;AACnD,UAAA,eAAe,kBAAkB,0BAA0B;AAE3D,UAAA;AAAA;AAAA,IAEN,QAAQ,oBAAoB,EAAE;AAAA,IAC9B;AAAA,IACA;AAAA,EACF;AAEM,QAAA,MAAM,QAAQ,IAAI;AAElB,QAAA,WAAW,KAAK,SAAS,SAAS;AAClC,QAAA,YAAY,KAAK,SAAS,UAAU;AAEpC,QAAA,SAAS,aAAa,EAAE,OAAO,UAAU,QAAQ,WAAW,WAAW,OAAO;AAEpF,QAAM,WAAW,aAAa;AAAA,IAC5B;AAAA,IACA,MAAM;AAAA,IACN;AAAA,EAAA,CACD;AAED,QAAM,MAAM;AAAA,IACV;AAAA,IACA;AAAA,IACA;AAAA,EACF;AAGA,aAAW,kBAAkBA,UAAgB;AACvC,QAAA;AACF,YAAM,aAAa,MAAM,eAAe,EAAE,SAAS,MAAM,KAAK;AAG9D,UAAI,YAAY;AACd,gBAAQ,WAAW,UAAU;AAAA,MAAA;AAAA,aAExB,GAAG;AACF,cAAA,MAAM,0BAA0B,CAAC;AAAA,IAAA;AAAA,EAC3C;AAIF,QAAM,qBAAqB;AAAA,IACzB,EAAE,MAAM,eAAe,SAAS,oDAAoD;AAAA,IACpF;AAAA,MACE,MAAM;AAAA,MACN,SAAS;AAAA,IACX;AAAA,IACA;AAAA,MACE,MAAM;AAAA,MACN,SAAS;AAAA,IACX;AAAA,IACA;AAAA,MACE,MAAM;AAAA,MACN,SAAS;AAAA,IACX;AAAA,IACA;AAAA,MACE,MAAM;AAAA,MACN,SAAS;AAAA,IAAA;AAAA,EAEb;AAGA,qBAAmB,QAAQ,CAAC,EAAE,MAAM,cAAc;AAChD,UAAM,aAAa,IAAI,QAAQ,IAAI,EAChC,QAAQ,IAAI,EACZ,YAAY,cAAc,EAC1B,OAAO,MAAM;AACJ,cAAA;AAAA,QACN,eAAe,IAAI;AAAA,MACrB;AACA,UAAI,SAAS;AACX,gBAAQ,KAAK,OAAO;AAAA,MAAA;AAAA,IACtB,CACD;AACH,YAAQ,WAAW,YAAY,EAAE,QAAQ,MAAM;AAAA,EAAA,CAChD;AACM,SAAA;AACT;AAEM,MAAA,SAAS,OAAO,OAAO,QAAQ,MAAM,UAAU,IAAI,cAAc;AACrE,QAAMC,YAAW,MAAM,UAAU,MAAM,OAAO;AACxC,QAAAA,UAAS,WAAW,IAAI;AAChC;"}
@@ -1,111 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
- const inquirer = require("inquirer");
4
- const commander = require("commander");
5
- const chalk = require("chalk");
6
- const fp = require("lodash/fp");
7
- const helpers = require("./helpers.js");
8
- const _interopDefault = (e) => e && e.__esModule ? e : { default: e };
9
- const inquirer__default = /* @__PURE__ */ _interopDefault(inquirer);
10
- const chalk__default = /* @__PURE__ */ _interopDefault(chalk);
11
- const parseList = (value) => {
12
- try {
13
- return value.split(",").map((item) => item.trim());
14
- } catch (e) {
15
- helpers.exitWith(1, `Unrecognized input: ${value}`);
16
- }
17
- return [];
18
- };
19
- const getParseListWithChoices = (choices, errorMessage = "Invalid options:") => {
20
- return (value) => {
21
- const list = parseList(value);
22
- const invalid = list.filter((item) => {
23
- return !choices.includes(item);
24
- });
25
- if (invalid.length > 0) {
26
- helpers.exitWith(1, `${errorMessage}: ${invalid.join(",")}`);
27
- }
28
- return list;
29
- };
30
- };
31
- const parseInteger = (value) => {
32
- const parsedValue = parseInt(value, 10);
33
- if (fp.isNaN(parsedValue)) {
34
- throw new commander.InvalidOptionArgumentError(`Not an integer: ${value}`);
35
- }
36
- return parsedValue;
37
- };
38
- const parseURL = (value) => {
39
- try {
40
- const url = new URL(value);
41
- if (!url.host) {
42
- throw new commander.InvalidOptionArgumentError(`Could not parse url ${value}`);
43
- }
44
- return url;
45
- } catch (e) {
46
- throw new commander.InvalidOptionArgumentError(`Could not parse url ${value}`);
47
- }
48
- };
49
- const promptEncryptionKey = async (thisCommand) => {
50
- const opts = thisCommand.opts();
51
- if (!opts.encrypt && opts.key) {
52
- return helpers.exitWith(1, "Key may not be present unless encryption is used");
53
- }
54
- if (opts.encrypt && !(opts.key && opts.key.length > 0)) {
55
- try {
56
- const answers = await inquirer__default.default.prompt([
57
- {
58
- type: "password",
59
- message: "Please enter an encryption key",
60
- name: "key",
61
- validate(key) {
62
- if (key.length > 0) return true;
63
- return "Key must be present when using the encrypt option";
64
- }
65
- }
66
- ]);
67
- opts.key = answers.key;
68
- } catch (e) {
69
- return helpers.exitWith(1, "Failed to get encryption key");
70
- }
71
- if (!opts.key) {
72
- return helpers.exitWith(1, "Failed to get encryption key");
73
- }
74
- }
75
- };
76
- const getCommanderConfirmMessage = (message, { failMessage } = {}) => {
77
- return async (command) => {
78
- const confirmed = await confirmMessage(message, { force: command.opts().force });
79
- if (!confirmed) {
80
- helpers.exitWith(1, failMessage);
81
- }
82
- };
83
- };
84
- const confirmMessage = async (message, { force } = {}) => {
85
- if (force === true) {
86
- console.log(`${chalk__default.default.green("?")} ${chalk__default.default.bold(message)} ${chalk__default.default.cyan("Yes")}`);
87
- return true;
88
- }
89
- const answers = await inquirer__default.default.prompt([
90
- {
91
- type: "confirm",
92
- message,
93
- name: `confirm`,
94
- default: false
95
- }
96
- ]);
97
- return answers.confirm;
98
- };
99
- const forceOption = new commander.Option(
100
- "--force",
101
- `Automatically answer "yes" to all prompts, including potentially destructive requests, and run non-interactively.`
102
- );
103
- exports.confirmMessage = confirmMessage;
104
- exports.forceOption = forceOption;
105
- exports.getCommanderConfirmMessage = getCommanderConfirmMessage;
106
- exports.getParseListWithChoices = getParseListWithChoices;
107
- exports.parseInteger = parseInteger;
108
- exports.parseList = parseList;
109
- exports.parseURL = parseURL;
110
- exports.promptEncryptionKey = promptEncryptionKey;
111
- //# sourceMappingURL=commander.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"commander.js","sources":["../../../src/cli/utils/commander.ts"],"sourcesContent":["/**\n * This file includes hooks to use for commander.hook and argParsers for commander.argParser\n */\n\nimport inquirer from 'inquirer';\nimport { Command, InvalidOptionArgumentError, Option } from 'commander';\nimport chalk from 'chalk';\nimport { isNaN } from 'lodash/fp';\nimport { exitWith } from './helpers';\n\n/**\n * argParser: Parse a comma-delimited string as an array\n */\nconst parseList = (value: string) => {\n try {\n return value.split(',').map((item) => item.trim()); // trim shouldn't be necessary but might help catch unexpected whitespace characters\n } catch (e) {\n exitWith(1, `Unrecognized input: ${value}`);\n }\n\n return [];\n};\n\n/**\n * Returns an argParser that returns a list\n */\nconst getParseListWithChoices = (choices: string[], errorMessage = 'Invalid options:') => {\n return (value: string) => {\n const list = parseList(value);\n const invalid = list.filter((item) => {\n return !choices.includes(item);\n });\n\n if (invalid.length > 0) {\n exitWith(1, `${errorMessage}: ${invalid.join(',')}`);\n }\n\n return list;\n };\n};\n\n/**\n * argParser: Parse a string as an integer\n */\nconst parseInteger = (value: string) => {\n // parseInt takes a string and a radix\n const parsedValue = parseInt(value, 10);\n if (isNaN(parsedValue)) {\n throw new InvalidOptionArgumentError(`Not an integer: ${value}`);\n }\n return parsedValue;\n};\n\n/**\n * argParser: Parse a string as a URL object\n */\nconst parseURL = (value: string) => {\n try {\n const url = new URL(value);\n if (!url.host) {\n throw new InvalidOptionArgumentError(`Could not parse url ${value}`);\n }\n\n return url;\n } catch (e) {\n throw new InvalidOptionArgumentError(`Could not parse url ${value}`);\n }\n};\n\n/**\n * hook: if encrypt==true and key not provided, prompt for it\n */\nconst promptEncryptionKey = async (thisCommand: Command) => {\n const opts = thisCommand.opts();\n\n if (!opts.encrypt && opts.key) {\n return exitWith(1, 'Key may not be present unless encryption is used');\n }\n\n // if encrypt==true but we have no key, prompt for it\n if (opts.encrypt && !(opts.key && opts.key.length > 0)) {\n try {\n const answers = await inquirer.prompt([\n {\n type: 'password',\n message: 'Please enter an encryption key',\n name: 'key',\n validate(key) {\n if (key.length > 0) return true;\n\n return 'Key must be present when using the encrypt option';\n },\n },\n ]);\n opts.key = answers.key;\n } catch (e) {\n return exitWith(1, 'Failed to get encryption key');\n }\n if (!opts.key) {\n return exitWith(1, 'Failed to get encryption key');\n }\n }\n};\n\n/**\n * hook: require a confirmation message to be accepted unless forceOption (-f,--force) is used\n */\nconst getCommanderConfirmMessage = (\n message: string,\n { failMessage }: { failMessage?: string } = {}\n) => {\n return async (command: Command) => {\n const confirmed = await confirmMessage(message, { force: command.opts().force });\n if (!confirmed) {\n exitWith(1, failMessage);\n }\n };\n};\n\nconst confirmMessage = async (message: string, { force }: { force?: boolean } = {}) => {\n // if we have a force option, respond yes\n if (force === true) {\n // attempt to mimic the inquirer prompt exactly\n console.log(`${chalk.green('?')} ${chalk.bold(message)} ${chalk.cyan('Yes')}`);\n return true;\n }\n\n const answers = await inquirer.prompt([\n {\n type: 'confirm',\n message,\n name: `confirm`,\n default: false,\n },\n ]);\n\n return answers.confirm;\n};\n\nconst forceOption = new Option(\n '--force',\n `Automatically answer \"yes\" to all prompts, including potentially destructive requests, and run non-interactively.`\n);\n\nexport {\n getParseListWithChoices,\n parseList,\n parseURL,\n parseInteger,\n promptEncryptionKey,\n getCommanderConfirmMess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AAA;AAAA,EACtB;AAAA,EACA;AACF;;;;;;;;;"}
@@ -1,108 +0,0 @@
1
- import inquirer from "inquirer";
2
- import { Option, InvalidOptionArgumentError } from "commander";
3
- import chalk from "chalk";
4
- import { isNaN } from "lodash/fp";
5
- import { exitWith } from "./helpers.mjs";
6
- const parseList = (value) => {
7
- try {
8
- return value.split(",").map((item) => item.trim());
9
- } catch (e) {
10
- exitWith(1, `Unrecognized input: ${value}`);
11
- }
12
- return [];
13
- };
14
- const getParseListWithChoices = (choices, errorMessage = "Invalid options:") => {
15
- return (value) => {
16
- const list = parseList(value);
17
- const invalid = list.filter((item) => {
18
- return !choices.includes(item);
19
- });
20
- if (invalid.length > 0) {
21
- exitWith(1, `${errorMessage}: ${invalid.join(",")}`);
22
- }
23
- return list;
24
- };
25
- };
26
- const parseInteger = (value) => {
27
- const parsedValue = parseInt(value, 10);
28
- if (isNaN(parsedValue)) {
29
- throw new InvalidOptionArgumentError(`Not an integer: ${value}`);
30
- }
31
- return parsedValue;
32
- };
33
- const parseURL = (value) => {
34
- try {
35
- const url = new URL(value);
36
- if (!url.host) {
37
- throw new InvalidOptionArgumentError(`Could not parse url ${value}`);
38
- }
39
- return url;
40
- } catch (e) {
41
- throw new InvalidOptionArgumentError(`Could not parse url ${value}`);
42
- }
43
- };
44
- const promptEncryptionKey = async (thisCommand) => {
45
- const opts = thisCommand.opts();
46
- if (!opts.encrypt && opts.key) {
47
- return exitWith(1, "Key may not be present unless encryption is used");
48
- }
49
- if (opts.encrypt && !(opts.key && opts.key.length > 0)) {
50
- try {
51
- const answers = await inquirer.prompt([
52
- {
53
- type: "password",
54
- message: "Please enter an encryption key",
55
- name: "key",
56
- validate(key) {
57
- if (key.length > 0) return true;
58
- return "Key must be present when using the encrypt option";
59
- }
60
- }
61
- ]);
62
- opts.key = answers.key;
63
- } catch (e) {
64
- return exitWith(1, "Failed to get encryption key");
65
- }
66
- if (!opts.key) {
67
- return exitWith(1, "Failed to get encryption key");
68
- }
69
- }
70
- };
71
- const getCommanderConfirmMessage = (message, { failMessage } = {}) => {
72
- return async (command) => {
73
- const confirmed = await confirmMessage(message, { force: command.opts().force });
74
- if (!confirmed) {
75
- exitWith(1, failMessage);
76
- }
77
- };
78
- };
79
- const confirmMessage = async (message, { force } = {}) => {
80
- if (force === true) {
81
- console.log(`${chalk.green("?")} ${chalk.bold(message)} ${chalk.cyan("Yes")}`);
82
- return true;
83
- }
84
- const answers = await inquirer.prompt([
85
- {
86
- type: "confirm",
87
- message,
88
- name: `confirm`,
89
- default: false
90
- }
91
- ]);
92
- return answers.confirm;
93
- };
94
- const forceOption = new Option(
95
- "--force",
96
- `Automatically answer "yes" to all prompts, including potentially destructive requests, and run non-interactively.`
97
- );
98
- export {
99
- confirmMessage,
100
- forceOption,
101
- getCommanderConfirmMessage,
102
- getParseListWithChoices,
103
- parseInteger,
104
- parseList,
105
- parseURL,
106
- promptEncryptionKey
107
- };
108
- //# sourceMappingURL=commander.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"commander.mjs","sources":["../../../src/cli/utils/commander.ts"],"sourcesContent":["/**\n * This file includes hooks to use for commander.hook and argParsers for commander.argParser\n */\n\nimport inquirer from 'inquirer';\nimport { Command, InvalidOptionArgumentError, Option } from 'commander';\nimport chalk from 'chalk';\nimport { isNaN } from 'lodash/fp';\nimport { exitWith } from './helpers';\n\n/**\n * argParser: Parse a comma-delimited string as an array\n */\nconst parseList = (value: string) => {\n try {\n return value.split(',').map((item) => item.trim()); // trim shouldn't be necessary but might help catch unexpected whitespace characters\n } catch (e) {\n exitWith(1, `Unrecognized input: ${value}`);\n }\n\n return [];\n};\n\n/**\n * Returns an argParser that returns a list\n */\nconst getParseListWithChoices = (choices: string[], errorMessage = 'Invalid options:') => {\n return (value: string) => {\n const list = parseList(value);\n const invalid = list.filter((item) => {\n return !choices.includes(item);\n });\n\n if (invalid.length > 0) {\n exitWith(1, `${errorMessage}: ${invalid.join(',')}`);\n }\n\n return list;\n };\n};\n\n/**\n * argParser: Parse a string as an integer\n */\nconst parseInteger = (value: string) => {\n // parseInt takes a string and a radix\n const parsedValue = parseInt(value, 10);\n if (isNaN(parsedValue)) {\n throw new InvalidOptionArgumentError(`Not an integer: ${value}`);\n }\n return parsedValue;\n};\n\n/**\n * argParser: Parse a string as a URL object\n */\nconst parseURL = (value: string) => {\n try {\n const url = new URL(value);\n if (!url.host) {\n throw new InvalidOptionArgumentError(`Could not parse url ${value}`);\n }\n\n return url;\n } catch (e) {\n throw new InvalidOptionArgumentError(`Could not parse url ${value}`);\n }\n};\n\n/**\n * hook: if encrypt==true and key not provided, prompt for it\n */\nconst promptEncryptionKey = async (thisCommand: Command) => {\n const opts = thisCommand.opts();\n\n if (!opts.encrypt && opts.key) {\n return exitWith(1, 'Key may not be present unless encryption is used');\n }\n\n // if encrypt==true but we have no key, prompt for it\n if (opts.encrypt && !(opts.key && opts.key.length > 0)) {\n try {\n const answers = await inquirer.prompt([\n {\n type: 'password',\n message: 'Please enter an encryption key',\n name: 'key',\n validate(key) {\n if (key.length > 0) return true;\n\n return 'Key must be present when using the encrypt option';\n },\n },\n ]);\n opts.key = answers.key;\n } catch (e) {\n return exitWith(1, 'Failed to get encryption key');\n }\n if (!opts.key) {\n return exitWith(1, 'Failed to get encryption key');\n }\n }\n};\n\n/**\n * hook: require a confirmation message to be accepted unless forceOption (-f,--force) is used\n */\nconst getCommanderConfirmMessage = (\n message: string,\n { failMessage }: { failMessage?: string } = {}\n) => {\n return async (command: Command) => {\n const confirmed = await confirmMessage(message, { force: command.opts().force });\n if (!confirmed) {\n exitWith(1, failMessage);\n }\n };\n};\n\nconst confirmMessage = async (message: string, { force }: { force?: boolean } = {}) => {\n // if we have a force option, respond yes\n if (force === true) {\n // attempt to mimic the inquirer prompt exactly\n console.log(`${chalk.green('?')} ${chalk.bold(message)} ${chalk.cyan('Yes')}`);\n return true;\n }\n\n const answers = await inquirer.prompt([\n {\n type: 'confirm',\n message,\n name: `confirm`,\n default: false,\n },\n ]);\n\n return answers.confirm;\n};\n\nconst forceOption = new Option(\n '--force',\n `Automatically answer \"yes\" to all prompts, including potentially destructive requests, and run non-interactively.`\n);\n\nexport {\n getParseListWithChoices,\n parseList,\n parseURL,\n parseInteger,\n promptEncryptionKey,\n getCommanderConfirmMessage,\n confirmMessage,\n forceOption,\n};\n"],"names":[],"mappings":";;;;;AAaM,MAAA,YAAY,CAAC,UAAkB;AAC/B,MAAA;AACK,WAAA,MAAM,MAAM,GAAG,EAAE,IAAI,CAAC,SAAS,KAAK,MAAM;AAAA,WAC1C,GAAG;AACD,aAAA,GAAG,uBAAuB,KAAK,EAAE;AAAA,EAAA;AAG5C,SAAO,CAAC;AACV;AAKA,MAAM,0BAA0B,CAAC,SAAmB,eAAe,uBAAuB;AACxF,SAAO,CAAC,UAAkB;AAClB,UAAA,OAAO,UAAU,KAAK;AAC5B,UAAM,UAAU,KAAK,OAAO,CAAC,SAAS;AAC7B,aAAA,CAAC,QAAQ,SAAS,IAAI;AAAA,IAAA,CAC9B;AAEG,QAAA,QAAQ,SAAS,GAAG;AACb,eAAA,GAAG,GAAG,YAAY,KAAK,QAAQ,KAAK,GAAG,CAAC,EAAE;AAAA,IAAA;AAG9C,WAAA;AAAA,EACT;AACF;AAKM,MAAA,eAAe,CAAC,UAAkB;AAEhC,QAAA,cAAc,SAAS,OAAO,EAAE;AAClC,MAAA,MAAM,WAAW,GAAG;AACtB,UAAM,IAAI,2BAA2B,mBAAmB,KAAK,EAAE;AAAA,EAAA;AAE1D,SAAA;AACT;AAKM,MAAA,WAAW,CAAC,UAAkB;AAC9B,MAAA;AACI,UAAA,MAAM,IAAI,IAAI,KAAK;AACrB,QAAA,CAAC,IAAI,MAAM;AACb,YAAM,IAAI,2BAA2B,uBAAuB,KAAK,EAAE;AAAA,IAAA;AAG9D,WAAA;AAAA,WACA,GAAG;AACV,UAAM,IAAI,2BAA2B,uBAAuB,KAAK,EAAE;AAAA,EAAA;AAEvE;AAKM,MAAA,sBAAsB,OAAO,gBAAy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