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

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 (204) hide show
  1. package/dist/admin.d.ts.map +1 -1
  2. package/dist/admin.js +5 -0
  3. package/dist/admin.js.map +1 -1
  4. package/dist/admin.mjs +4 -0
  5. package/dist/admin.mjs.map +1 -1
  6. package/dist/cli/commands/admin/create-user.js +2 -2
  7. package/dist/cli/commands/admin/create-user.js.map +1 -1
  8. package/dist/cli/commands/admin/create-user.mjs +88 -0
  9. package/dist/cli/commands/admin/create-user.mjs.map +1 -0
  10. package/dist/cli/commands/admin/reset-user-password.js +2 -2
  11. package/dist/cli/commands/admin/reset-user-password.js.map +1 -1
  12. package/dist/cli/commands/admin/reset-user-password.mjs +44 -0
  13. package/dist/cli/commands/admin/reset-user-password.mjs.map +1 -0
  14. package/dist/cli/commands/build.mjs +30 -0
  15. package/dist/cli/commands/build.mjs.map +1 -0
  16. package/dist/cli/commands/components/list.js +2 -2
  17. package/dist/cli/commands/components/list.js.map +1 -1
  18. package/dist/cli/commands/components/list.mjs +24 -0
  19. package/dist/cli/commands/components/list.mjs.map +1 -0
  20. package/dist/cli/commands/configuration/dump.js +2 -2
  21. package/dist/cli/commands/configuration/dump.js.map +1 -1
  22. package/dist/cli/commands/configuration/dump.mjs +41 -0
  23. package/dist/cli/commands/configuration/dump.mjs.map +1 -0
  24. package/dist/cli/commands/configuration/restore.js +2 -2
  25. package/dist/cli/commands/configuration/restore.js.map +1 -1
  26. package/dist/cli/commands/configuration/restore.mjs +140 -0
  27. package/dist/cli/commands/configuration/restore.mjs.map +1 -0
  28. package/dist/cli/commands/console.js +2 -2
  29. package/dist/cli/commands/console.js.map +1 -1
  30. package/dist/cli/commands/console.mjs +27 -0
  31. package/dist/cli/commands/console.mjs.map +1 -0
  32. package/dist/cli/commands/content-types/list.js +2 -2
  33. package/dist/cli/commands/content-types/list.js.map +1 -1
  34. package/dist/cli/commands/content-types/list.mjs +24 -0
  35. package/dist/cli/commands/content-types/list.mjs.map +1 -0
  36. package/dist/cli/commands/controllers/list.js +2 -2
  37. package/dist/cli/commands/controllers/list.js.map +1 -1
  38. package/dist/cli/commands/controllers/list.mjs +24 -0
  39. package/dist/cli/commands/controllers/list.mjs.map +1 -0
  40. package/dist/cli/commands/develop.mjs +27 -0
  41. package/dist/cli/commands/develop.mjs.map +1 -0
  42. package/dist/cli/commands/export/action.mjs +116 -0
  43. package/dist/cli/commands/export/action.mjs.map +1 -0
  44. package/dist/cli/commands/export/command.mjs +24 -0
  45. package/dist/cli/commands/export/command.mjs.map +1 -0
  46. package/dist/cli/commands/generate.mjs +13 -0
  47. package/dist/cli/commands/generate.mjs.map +1 -0
  48. package/dist/cli/commands/hooks/list.js +2 -2
  49. package/dist/cli/commands/hooks/list.js.map +1 -1
  50. package/dist/cli/commands/hooks/list.mjs +24 -0
  51. package/dist/cli/commands/hooks/list.mjs.map +1 -0
  52. package/dist/cli/commands/import/action.mjs +105 -0
  53. package/dist/cli/commands/import/action.mjs.map +1 -0
  54. package/dist/cli/commands/import/command.mjs +68 -0
  55. package/dist/cli/commands/import/command.mjs.map +1 -0
  56. package/dist/cli/commands/index.mjs +71 -0
  57. package/dist/cli/commands/index.mjs.map +1 -0
  58. package/dist/cli/commands/middlewares/list.js +2 -2
  59. package/dist/cli/commands/middlewares/list.js.map +1 -1
  60. package/dist/cli/commands/middlewares/list.mjs +24 -0
  61. package/dist/cli/commands/middlewares/list.mjs.map +1 -0
  62. package/dist/cli/commands/plugin/build.mjs +85 -0
  63. package/dist/cli/commands/plugin/build.mjs.map +1 -0
  64. package/dist/cli/commands/plugin/init/action.js +1 -1
  65. package/dist/cli/commands/plugin/init/action.js.map +1 -1
  66. package/dist/cli/commands/plugin/init/action.mjs +409 -0
  67. package/dist/cli/commands/plugin/init/action.mjs.map +1 -0
  68. package/dist/cli/commands/plugin/init/command.mjs +10 -0
  69. package/dist/cli/commands/plugin/init/command.mjs.map +1 -0
  70. package/dist/cli/commands/plugin/init/files/admin.mjs +283 -0
  71. package/dist/cli/commands/plugin/init/files/admin.mjs.map +1 -0
  72. package/dist/cli/commands/plugin/init/files/editorConfig.mjs +26 -0
  73. package/dist/cli/commands/plugin/init/files/editorConfig.mjs.map +1 -0
  74. package/dist/cli/commands/plugin/init/files/eslint.mjs +11 -0
  75. package/dist/cli/commands/plugin/init/files/eslint.mjs.map +1 -0
  76. package/dist/cli/commands/plugin/init/files/gitIgnore.mjs +34 -0
  77. package/dist/cli/commands/plugin/init/files/gitIgnore.mjs.map +1 -0
  78. package/dist/cli/commands/plugin/init/files/prettier.mjs +25 -0
  79. package/dist/cli/commands/plugin/init/files/prettier.mjs.map +1 -0
  80. package/dist/cli/commands/plugin/init/files/server.mjs +360 -0
  81. package/dist/cli/commands/plugin/init/files/server.mjs.map +1 -0
  82. package/dist/cli/commands/plugin/init/files/typescript.mjs +66 -0
  83. package/dist/cli/commands/plugin/init/files/typescript.mjs.map +1 -0
  84. package/dist/cli/commands/plugin/link-watch.mjs +82 -0
  85. package/dist/cli/commands/plugin/link-watch.mjs.map +1 -0
  86. package/dist/cli/commands/plugin/verify.mjs +34 -0
  87. package/dist/cli/commands/plugin/verify.mjs.map +1 -0
  88. package/dist/cli/commands/plugin/watch.mjs +83 -0
  89. package/dist/cli/commands/plugin/watch.mjs.map +1 -0
  90. package/dist/cli/commands/policies/list.js +2 -2
  91. package/dist/cli/commands/policies/list.js.map +1 -1
  92. package/dist/cli/commands/policies/list.mjs +24 -0
  93. package/dist/cli/commands/policies/list.mjs.map +1 -0
  94. package/dist/cli/commands/report.js +2 -2
  95. package/dist/cli/commands/report.js.map +1 -1
  96. package/dist/cli/commands/report.mjs +35 -0
  97. package/dist/cli/commands/report.mjs.map +1 -0
  98. package/dist/cli/commands/routes/list.js +2 -2
  99. package/dist/cli/commands/routes/list.js.map +1 -1
  100. package/dist/cli/commands/routes/list.mjs +28 -0
  101. package/dist/cli/commands/routes/list.mjs.map +1 -0
  102. package/dist/cli/commands/services/list.js +2 -2
  103. package/dist/cli/commands/services/list.js.map +1 -1
  104. package/dist/cli/commands/services/list.mjs +24 -0
  105. package/dist/cli/commands/services/list.mjs.map +1 -0
  106. package/dist/cli/commands/start.js +1 -1
  107. package/dist/cli/commands/start.js.map +1 -1
  108. package/dist/cli/commands/start.mjs +24 -0
  109. package/dist/cli/commands/start.mjs.map +1 -0
  110. package/dist/cli/commands/telemetry/disable.mjs +67 -0
  111. package/dist/cli/commands/telemetry/disable.mjs.map +1 -0
  112. package/dist/cli/commands/telemetry/enable.mjs +86 -0
  113. package/dist/cli/commands/telemetry/enable.mjs.map +1 -0
  114. package/dist/cli/commands/templates/generate.mjs +74 -0
  115. package/dist/cli/commands/templates/generate.mjs.map +1 -0
  116. package/dist/cli/commands/transfer/action.mjs +131 -0
  117. package/dist/cli/commands/transfer/action.mjs.map +1 -0
  118. package/dist/cli/commands/transfer/command.mjs +84 -0
  119. package/dist/cli/commands/transfer/command.mjs.map +1 -0
  120. package/dist/cli/commands/ts/generate-types.js +2 -2
  121. package/dist/cli/commands/ts/generate-types.js.map +1 -1
  122. package/dist/cli/commands/ts/generate-types.mjs +35 -0
  123. package/dist/cli/commands/ts/generate-types.mjs.map +1 -0
  124. package/dist/cli/commands/version.mjs +13 -0
  125. package/dist/cli/commands/version.mjs.map +1 -0
  126. package/dist/cli/index.mjs +49 -0
  127. package/dist/cli/index.mjs.map +1 -0
  128. package/dist/cli/utils/commander.mjs +109 -0
  129. package/dist/cli/utils/commander.mjs.map +1 -0
  130. package/dist/cli/utils/data-transfer.js +2 -2
  131. package/dist/cli/utils/data-transfer.js.map +1 -1
  132. package/dist/cli/utils/data-transfer.mjs +339 -0
  133. package/dist/cli/utils/data-transfer.mjs.map +1 -0
  134. package/dist/cli/utils/helpers.mjs +100 -0
  135. package/dist/cli/utils/helpers.mjs.map +1 -0
  136. package/dist/cli/utils/logger.mjs +80 -0
  137. package/dist/cli/utils/logger.mjs.map +1 -0
  138. package/dist/cli/utils/pkg.d.ts.map +1 -1
  139. package/dist/cli/utils/pkg.js +18 -15
  140. package/dist/cli/utils/pkg.js.map +1 -1
  141. package/dist/cli/utils/pkg.mjs +87 -0
  142. package/dist/cli/utils/pkg.mjs.map +1 -0
  143. package/dist/cli/utils/telemetry.mjs +22 -0
  144. package/dist/cli/utils/telemetry.mjs.map +1 -0
  145. package/dist/cli/utils/tsconfig.mjs +23 -0
  146. package/dist/cli/utils/tsconfig.mjs.map +1 -0
  147. package/dist/node/build.mjs +58 -0
  148. package/dist/node/build.mjs.map +1 -0
  149. package/dist/node/core/admin-customisations.mjs +22 -0
  150. package/dist/node/core/admin-customisations.mjs.map +1 -0
  151. package/dist/node/core/aliases.d.ts.map +1 -1
  152. package/dist/node/core/aliases.js +3 -1
  153. package/dist/node/core/aliases.js.map +1 -1
  154. package/dist/node/core/aliases.mjs +30 -0
  155. package/dist/node/core/aliases.mjs.map +1 -0
  156. package/dist/node/core/config.mjs +16 -0
  157. package/dist/node/core/config.mjs.map +1 -0
  158. package/dist/node/core/dependencies.mjs +151 -0
  159. package/dist/node/core/dependencies.mjs.map +1 -0
  160. package/dist/node/core/env.d.ts.map +1 -1
  161. package/dist/node/core/env.js +7 -4
  162. package/dist/node/core/env.js.map +1 -1
  163. package/dist/node/core/env.mjs +23 -0
  164. package/dist/node/core/env.mjs.map +1 -0
  165. package/dist/node/core/errors.mjs +29 -0
  166. package/dist/node/core/errors.mjs.map +1 -0
  167. package/dist/node/core/files.mjs +43 -0
  168. package/dist/node/core/files.mjs.map +1 -0
  169. package/dist/node/core/managers.mjs +17 -0
  170. package/dist/node/core/managers.mjs.map +1 -0
  171. package/dist/node/core/monorepo.mjs +20 -0
  172. package/dist/node/core/monorepo.mjs.map +1 -0
  173. package/dist/node/core/plugins.mjs +93 -0
  174. package/dist/node/core/plugins.mjs.map +1 -0
  175. package/dist/node/core/timer.mjs +27 -0
  176. package/dist/node/core/timer.mjs.map +1 -0
  177. package/dist/node/create-build-context.js +1 -1
  178. package/dist/node/create-build-context.js.map +1 -1
  179. package/dist/node/create-build-context.mjs +91 -0
  180. package/dist/node/create-build-context.mjs.map +1 -0
  181. package/dist/node/develop.js +1 -1
  182. package/dist/node/develop.js.map +1 -1
  183. package/dist/node/develop.mjs +252 -0
  184. package/dist/node/develop.mjs.map +1 -0
  185. package/dist/node/staticFiles.d.ts.map +1 -1
  186. package/dist/node/staticFiles.js +25 -3
  187. package/dist/node/staticFiles.js.map +1 -1
  188. package/dist/node/staticFiles.mjs +76 -0
  189. package/dist/node/staticFiles.mjs.map +1 -0
  190. package/dist/node/vite/build.mjs +12 -0
  191. package/dist/node/vite/build.mjs.map +1 -0
  192. package/dist/node/vite/config.mjs +99 -0
  193. package/dist/node/vite/config.mjs.map +1 -0
  194. package/dist/node/vite/plugins.mjs +43 -0
  195. package/dist/node/vite/plugins.mjs.map +1 -0
  196. package/dist/node/vite/watch.mjs +52 -0
  197. package/dist/node/vite/watch.mjs.map +1 -0
  198. package/dist/node/webpack/build.mjs +39 -0
  199. package/dist/node/webpack/build.mjs.map +1 -0
  200. package/dist/node/webpack/config.mjs +228 -0
  201. package/dist/node/webpack/config.mjs.map +1 -0
  202. package/dist/node/webpack/watch.mjs +92 -0
  203. package/dist/node/webpack/watch.mjs.map +1 -0
  204. package/package.json +24 -24
@@ -0,0 +1 @@
1
+ {"version":3,"file":"watch.mjs","sources":["../../../../src/cli/commands/plugin/watch.ts"],"sourcesContent":["import { createCommand } from 'commander';\nimport boxen from 'boxen';\nimport chalk from 'chalk';\nimport { ConfigBundle, WatchCLIOptions, watch } from '@strapi/pack-up';\n\nimport { runAction } from '../../utils/helpers';\nimport { Export, loadPkg, validatePkg } from '../../utils/pkg';\nimport type { StrapiCommand, CLIContext } from '../../types';\n\ntype ActionOptions = WatchCLIOptions;\n\nconst action = async (opts: ActionOptions, _cmd: unknown, { cwd, logger }: CLIContext) => {\n try {\n const pkg = await loadPkg({ cwd, logger });\n const pkgJson = await validatePkg({ pkg });\n\n if (!pkgJson.exports['./strapi-admin'] && !pkgJson.exports['./strapi-server']) {\n throw new Error(\n 'You need to have either a strapi-admin or strapi-server export in your package.json'\n );\n }\n\n const bundles: ConfigBundle[] = [];\n\n if (pkgJson.exports['./strapi-admin']) {\n const exp = pkgJson.exports['./strapi-admin'] as Export;\n\n const bundle: ConfigBundle = {\n source: exp.source,\n import: exp.import,\n require: exp.require,\n runtime: 'web',\n };\n\n if (exp.types) {\n bundle.types = exp.types;\n // TODO: should this be sliced from the source path...?\n bundle.tsconfig = './admin/tsconfig.build.json';\n }\n\n bundles.push(bundle);\n }\n\n if (pkgJson.exports['./strapi-server']) {\n const exp = pkgJson.exports['./strapi-server'] as Export;\n\n const bundle: ConfigBundle = {\n source: exp.source,\n import: exp.import,\n require: exp.require,\n runtime: 'node',\n };\n\n if (exp.types) {\n bundle.types = exp.types;\n // TODO: should this be sliced from the source path...?\n bundle.tsconfig = './server/tsconfig.build.json';\n }\n\n bundles.push(bundle);\n }\n\n await watch({\n cwd,\n configFile: false,\n config: {\n bundles,\n dist: './dist',\n /**\n * ignore the exports map of a plugin, because we're streamlining the\n * process and ensuring the server package and admin package are built\n * with the correct runtime and their individual tsconfigs\n */\n exports: {},\n },\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:watch`\n */\nconst command: StrapiCommand = ({ ctx }) => {\n return createCommand('plugin:watch')\n .description('Watch & compile your strapi plugin for local development.')\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', action)(...args, ctx));\n};\n\nexport { command };\n"],"names":[],"mappings":";;;;;;AAWA,MAAM,SAAS,OAAO,MAAqB,MAAe,EAAE,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A;AAAA,QACN,MAAM;AAAA,UACJ,MAAM,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,UAAU;AACnC,SAAA,cAAc,cAAc,EAChC,YAAY,2DAA2D,EACvE,OAAO,eAAe,2CAA2C,KAAK,EACtE,OAAO,YAAY,sBAAsB,KAAK,EAC9C,OAAO,IAAI,SAAS,UAAU,gBAAgB,MAAM,EAAE,GAAG,MAAM,GAAG,CAAC;AACxE;"}
@@ -9,8 +9,8 @@ const _interopDefault = (e) => e && e.__esModule ? e : { default: e };
9
9
  const CLITable__default = /* @__PURE__ */ _interopDefault(CLITable);
10
10
  const chalk__default = /* @__PURE__ */ _interopDefault(chalk);
11
11
  const action = async () => {
12
- const appContext = await core.strapiFactory.compile();
13
- const app = await core.strapiFactory(appContext).register();
12
+ const appContext = await core.compileStrapi();
13
+ const app = await core.createStrapi(appContext).register();
14
14
  const list = app.get("policies").keys();
15
15
  const infoTable = new CLITable__default.default({
16
16
  head: [chalk__default.default.blue("Name")]
@@ -1 +1 @@
1
- {"version":3,"file":"list.js","sources":["../../../../src/cli/commands/policies/list.ts"],"sourcesContent":["import { createCommand } from 'commander';\nimport CLITable from 'cli-table3';\nimport chalk from 'chalk';\nimport { strapiFactory } from '@strapi/core';\n\nimport type { StrapiCommand } from '../../types';\nimport { runAction } from '../../utils/helpers';\n\nconst action = async () => {\n const appContext = await strapiFactory.compile();\n const app = await strapiFactory(appContext).register();\n\n const list = app.get('policies').keys();\n\n const infoTable = new CLITable({\n head: [chalk.blue('Name')],\n });\n\n list.forEach((name: string) => infoTable.push([name]));\n\n console.log(infoTable.toString());\n\n await app.destroy();\n};\n\n/**\n * `$ strapi policies:list`\n */\nconst command: StrapiCommand = () => {\n return createCommand('policies:list')\n .description('List all the application policies')\n .action(runAction('policies:list', action));\n};\n\nexport { action, command };\n"],"names":["strapiFactory","CLITable","chalk","createCommand","runAction"],"mappings":";;;;;;;;;;AAQA,MAAM,SAAS,YAAY;AACnB,QAAA,aAAa,MAAMA,mBAAc;AACvC,QAAM,MAAM,MAAMA,KAAAA,cAAc,UAAU,EAAE,SAAS;AAErD,QAAM,OAAO,IAAI,IAAI,UAAU,EAAE,KAAK;AAEhC,QAAA,YAAY,IAAIC,0BAAS;AAAA,IAC7B,MAAM,CAACC,eAAAA,QAAM,KAAK,MAAM,CAAC;AAAA,EAAA,CAC1B;AAEI,OAAA,QAAQ,CAAC,SAAiB,UAAU,KAAK,CAAC,IAAI,CAAC,CAAC;AAE7C,UAAA,IAAI,UAAU,SAAU,CAAA;AAEhC,QAAM,IAAI;AACZ;AAKA,MAAM,UAAyB,MAAM;AAC5B,SAAAC,wBAAc,eAAe,EACjC,YAAY,mCAAmC,EAC/C,OAAOC,kBAAU,iBAAiB,MAAM,CAAC;AAC9C;;;"}
1
+ {"version":3,"file":"list.js","sources":["../../../../src/cli/commands/policies/list.ts"],"sourcesContent":["import { createCommand } from 'commander';\nimport CLITable from 'cli-table3';\nimport chalk from 'chalk';\nimport { createStrapi, compileStrapi } from '@strapi/core';\n\nimport type { StrapiCommand } from '../../types';\nimport { runAction } from '../../utils/helpers';\n\nconst action = async () => {\n const appContext = await compileStrapi();\n const app = await createStrapi(appContext).register();\n\n const list = app.get('policies').keys();\n\n const infoTable = new CLITable({\n head: [chalk.blue('Name')],\n });\n\n list.forEach((name: string) => infoTable.push([name]));\n\n console.log(infoTable.toString());\n\n await app.destroy();\n};\n\n/**\n * `$ strapi policies:list`\n */\nconst command: StrapiCommand = () => {\n return createCommand('policies:list')\n .description('List all the application policies')\n .action(runAction('policies:list', action));\n};\n\nexport { action, command };\n"],"names":["compileStrapi","createStrapi","CLITable","chalk","createCommand","runAction"],"mappings":";;;;;;;;;;AAQA,MAAM,SAAS,YAAY;AACnB,QAAA,aAAa,MAAMA,KAAAA;AACzB,QAAM,MAAM,MAAMC,KAAAA,aAAa,UAAU,EAAE,SAAS;AAEpD,QAAM,OAAO,IAAI,IAAI,UAAU,EAAE,KAAK;AAEhC,QAAA,YAAY,IAAIC,0BAAS;AAAA,IAC7B,MAAM,CAACC,eAAAA,QAAM,KAAK,MAAM,CAAC;AAAA,EAAA,CAC1B;AAEI,OAAA,QAAQ,CAAC,SAAiB,UAAU,KAAK,CAAC,IAAI,CAAC,CAAC;AAE7C,UAAA,IAAI,UAAU,SAAU,CAAA;AAEhC,QAAM,IAAI;AACZ;AAKA,MAAM,UAAyB,MAAM;AAC5B,SAAAC,wBAAc,eAAe,EACjC,YAAY,mCAAmC,EAC/C,OAAOC,kBAAU,iBAAiB,MAAM,CAAC;AAC9C;;;"}
@@ -0,0 +1,24 @@
1
+ import { createCommand } from "commander";
2
+ import CLITable from "cli-table3";
3
+ import chalk from "chalk";
4
+ import { compileStrapi, createStrapi } from "@strapi/core";
5
+ import { runAction } from "../../utils/helpers.mjs";
6
+ const action = async () => {
7
+ const appContext = await compileStrapi();
8
+ const app = await createStrapi(appContext).register();
9
+ const list = app.get("policies").keys();
10
+ const infoTable = new CLITable({
11
+ head: [chalk.blue("Name")]
12
+ });
13
+ list.forEach((name) => infoTable.push([name]));
14
+ console.log(infoTable.toString());
15
+ await app.destroy();
16
+ };
17
+ const command = () => {
18
+ return createCommand("policies:list").description("List all the application policies").action(runAction("policies:list", action));
19
+ };
20
+ export {
21
+ action,
22
+ command
23
+ };
24
+ //# sourceMappingURL=list.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"list.mjs","sources":["../../../../src/cli/commands/policies/list.ts"],"sourcesContent":["import { createCommand } from 'commander';\nimport CLITable from 'cli-table3';\nimport chalk from 'chalk';\nimport { createStrapi, compileStrapi } from '@strapi/core';\n\nimport type { StrapiCommand } from '../../types';\nimport { runAction } from '../../utils/helpers';\n\nconst action = async () => {\n const appContext = await compileStrapi();\n const app = await createStrapi(appContext).register();\n\n const list = app.get('policies').keys();\n\n const infoTable = new CLITable({\n head: [chalk.blue('Name')],\n });\n\n list.forEach((name: string) => infoTable.push([name]));\n\n console.log(infoTable.toString());\n\n await app.destroy();\n};\n\n/**\n * `$ strapi policies:list`\n */\nconst command: StrapiCommand = () => {\n return createCommand('policies:list')\n .description('List all the application policies')\n .action(runAction('policies:list', action));\n};\n\nexport { action, command };\n"],"names":[],"mappings":";;;;;AAQA,MAAM,SAAS,YAAY;AACnB,QAAA,aAAa,MAAM;AACzB,QAAM,MAAM,MAAM,aAAa,UAAU,EAAE,SAAS;AAEpD,QAAM,OAAO,IAAI,IAAI,UAAU,EAAE,KAAK;AAEhC,QAAA,YAAY,IAAI,SAAS;AAAA,IAC7B,MAAM,CAAC,MAAM,KAAK,MAAM,CAAC;AAAA,EAAA,CAC1B;AAEI,OAAA,QAAQ,CAAC,SAAiB,UAAU,KAAK,CAAC,IAAI,CAAC,CAAC;AAE7C,UAAA,IAAI,UAAU,SAAU,CAAA;AAEhC,QAAM,IAAI;AACZ;AAKA,MAAM,UAAyB,MAAM;AAC5B,SAAA,cAAc,eAAe,EACjC,YAAY,mCAAmC,EAC/C,OAAO,UAAU,iBAAiB,MAAM,CAAC;AAC9C;"}
@@ -9,8 +9,8 @@ const action = async ({ uuid, dependencies, all }) => {
9
9
  reportUUID: Boolean(all || uuid),
10
10
  reportDependencies: Boolean(all || dependencies)
11
11
  };
12
- const appContext = await core.strapiFactory.compile();
13
- const app = await core.strapiFactory(appContext).register();
12
+ const appContext = await core.compileStrapi();
13
+ const app = await core.createStrapi(appContext).register();
14
14
  let debugInfo = `Launched In: ${Date.now() - app.config.launchedAt} ms
15
15
  Environment: ${app.config.environment}
16
16
  OS: ${process.platform}-${process.arch}
@@ -1 +1 @@
1
- {"version":3,"file":"report.js","sources":["../../../src/cli/commands/report.ts"],"sourcesContent":["import { createCommand } from 'commander';\nimport { EOL } from 'os';\nimport { strapiFactory } from '@strapi/core';\nimport type { StrapiCommand } from '../types';\nimport { runAction } from '../utils/helpers';\n\ninterface CmdOptions {\n uuid: boolean;\n dependencies: boolean;\n all: boolean;\n}\n\nconst action = async ({ uuid, dependencies, all }: CmdOptions) => {\n const config = {\n reportUUID: Boolean(all || uuid),\n reportDependencies: Boolean(all || dependencies),\n };\n\n const appContext = await strapiFactory.compile();\n const app = await strapiFactory(appContext).register();\n\n let debugInfo = `Launched In: ${Date.now() - app.config.launchedAt} ms\nEnvironment: ${app.config.environment}\nOS: ${process.platform}-${process.arch}\nStrapi Version: ${app.config.info.strapi}\nNode/Yarn Version: ${process.env.npm_config_user_agent}\nEdition: ${app.EE ? 'Enterprise' : 'Community'}\nDatabase: ${app?.config?.database?.connection?.client ?? 'unknown'}`;\n\n if (config.reportUUID) {\n debugInfo += `${EOL}UUID: ${app.config.uuid}`;\n }\n\n if (config.reportDependencies) {\n debugInfo += `${EOL}Dependencies: ${JSON.stringify(app.config.info.dependencies, null, 2)}\nDev Dependencies: ${JSON.stringify(app.config.info.devDependencies, null, 2)}`;\n }\n\n console.log(debugInfo);\n\n await app.destroy();\n};\n\n/**\n * `$ strapi report`\n */\nconst command: StrapiCommand = () => {\n return createCommand('report')\n .description('Get system stats for debugging and submitting issues')\n .option('-u, --uuid', 'Include Project UUID')\n .option('-d, --dependencies', 'Include Project Dependencies')\n .option('--all', 'Include All Information')\n .action(runAction('report', action));\n};\n\nexport { command };\n"],"names":["strapiFactory","EOL","createCommand","runAction"],"mappings":";;;;;;AAYA,MAAM,SAAS,OAAO,EAAE,MAAM,cAAc,UAAsB;AAChE,QAAM,SAAS;AAAA,IACb,YAAY,QAAQ,OAAO,IAAI;AAAA,IAC/B,oBAAoB,QAAQ,OAAO,YAAY;AAAA,EAAA;AAG3C,QAAA,aAAa,MAAMA,mBAAc;AACvC,QAAM,MAAM,MAAMA,KAAAA,cAAc,UAAU,EAAE,SAAS;AAErD,MAAI,YAAY,gBAAgB,KAAK,QAAQ,IAAI,OAAO,UAAU;AAAA,eACrD,IAAI,OAAO,WAAW;AAAA,MAC/B,QAAQ,QAAQ,IAAI,QAAQ,IAAI;AAAA,kBACpB,IAAI,OAAO,KAAK,MAAM;AAAA,qBACnB,QAAQ,IAAI,qBAAqB;AAAA,WAC3C,IAAI,KAAK,eAAe,WAAW;AAAA,YAClC,KAAK,QAAQ,UAAU,YAAY,UAAU,SAAS;AAEhE,MAAI,OAAO,YAAY;AACrB,iBAAa,GAAGC,MAAG,SAAS,IAAI,OAAO,IAAI;AAAA,EAC7C;AAEA,MAAI,OAAO,oBAAoB;AAChB,iBAAA,GAAGA,GAAAA,GAAG,iBAAiB,KAAK,UAAU,IAAI,OAAO,KAAK,cAAc,MAAM,CAAC,CAAC;AAAA,oBACzE,KAAK,UAAU,IAAI,OAAO,KAAK,iBAAiB,MAAM,CAAC,CAAC;AAAA,EAC1E;AAEA,UAAQ,IAAI,SAAS;AAErB,QAAM,IAAI;AACZ;AAKA,MAAM,UAAyB,MAAM;AAC5B,SAAAC,UAAA,cAAc,QAAQ,EAC1B,YAAY,sDAAsD,EAClE,OAAO,cAAc,sBAAsB,EAC3C,OAAO,sBAAsB,8BAA8B,EAC3D,OAAO,SAAS,yBAAyB,EACzC,OAAOC,kBAAU,UAAU,MAAM,CAAC;AACvC;;"}
1
+ {"version":3,"file":"report.js","sources":["../../../src/cli/commands/report.ts"],"sourcesContent":["import { createCommand } from 'commander';\nimport { EOL } from 'os';\nimport { createStrapi, compileStrapi } from '@strapi/core';\nimport type { StrapiCommand } from '../types';\nimport { runAction } from '../utils/helpers';\n\ninterface CmdOptions {\n uuid: boolean;\n dependencies: boolean;\n all: boolean;\n}\n\nconst action = async ({ uuid, dependencies, all }: CmdOptions) => {\n const config = {\n reportUUID: Boolean(all || uuid),\n reportDependencies: Boolean(all || dependencies),\n };\n\n const appContext = await compileStrapi();\n const app = await createStrapi(appContext).register();\n\n let debugInfo = `Launched In: ${Date.now() - app.config.launchedAt} ms\nEnvironment: ${app.config.environment}\nOS: ${process.platform}-${process.arch}\nStrapi Version: ${app.config.info.strapi}\nNode/Yarn Version: ${process.env.npm_config_user_agent}\nEdition: ${app.EE ? 'Enterprise' : 'Community'}\nDatabase: ${app?.config?.database?.connection?.client ?? 'unknown'}`;\n\n if (config.reportUUID) {\n debugInfo += `${EOL}UUID: ${app.config.uuid}`;\n }\n\n if (config.reportDependencies) {\n debugInfo += `${EOL}Dependencies: ${JSON.stringify(app.config.info.dependencies, null, 2)}\nDev Dependencies: ${JSON.stringify(app.config.info.devDependencies, null, 2)}`;\n }\n\n console.log(debugInfo);\n\n await app.destroy();\n};\n\n/**\n * `$ strapi report`\n */\nconst command: StrapiCommand = () => {\n return createCommand('report')\n .description('Get system stats for debugging and submitting issues')\n .option('-u, --uuid', 'Include Project UUID')\n .option('-d, --dependencies', 'Include Project Dependencies')\n .option('--all', 'Include All Information')\n .action(runAction('report', action));\n};\n\nexport { command };\n"],"names":["compileStrapi","createStrapi","EOL","createCommand","runAction"],"mappings":";;;;;;AAYA,MAAM,SAAS,OAAO,EAAE,MAAM,cAAc,UAAsB;AAChE,QAAM,SAAS;AAAA,IACb,YAAY,QAAQ,OAAO,IAAI;AAAA,IAC/B,oBAAoB,QAAQ,OAAO,YAAY;AAAA,EAAA;AAG3C,QAAA,aAAa,MAAMA,KAAAA;AACzB,QAAM,MAAM,MAAMC,KAAAA,aAAa,UAAU,EAAE,SAAS;AAEpD,MAAI,YAAY,gBAAgB,KAAK,QAAQ,IAAI,OAAO,UAAU;AAAA,eACrD,IAAI,OAAO,WAAW;AAAA,MAC/B,QAAQ,QAAQ,IAAI,QAAQ,IAAI;AAAA,kBACpB,IAAI,OAAO,KAAK,MAAM;AAAA,qBACnB,QAAQ,IAAI,qBAAqB;AAAA,WAC3C,IAAI,KAAK,eAAe,WAAW;AAAA,YAClC,KAAK,QAAQ,UAAU,YAAY,UAAU,SAAS;AAEhE,MAAI,OAAO,YAAY;AACrB,iBAAa,GAAGC,MAAG,SAAS,IAAI,OAAO,IAAI;AAAA,EAC7C;AAEA,MAAI,OAAO,oBAAoB;AAChB,iBAAA,GAAGA,GAAAA,GAAG,iBAAiB,KAAK,UAAU,IAAI,OAAO,KAAK,cAAc,MAAM,CAAC,CAAC;AAAA,oBACzE,KAAK,UAAU,IAAI,OAAO,KAAK,iBAAiB,MAAM,CAAC,CAAC;AAAA,EAC1E;AAEA,UAAQ,IAAI,SAAS;AAErB,QAAM,IAAI;AACZ;AAKA,MAAM,UAAyB,MAAM;AAC5B,SAAAC,UAAA,cAAc,QAAQ,EAC1B,YAAY,sDAAsD,EAClE,OAAO,cAAc,sBAAsB,EAC3C,OAAO,sBAAsB,8BAA8B,EAC3D,OAAO,SAAS,yBAAyB,EACzC,OAAOC,kBAAU,UAAU,MAAM,CAAC;AACvC;;"}
@@ -0,0 +1,35 @@
1
+ import { createCommand } from "commander";
2
+ import { EOL } from "os";
3
+ import { compileStrapi, createStrapi } from "@strapi/core";
4
+ import { runAction } from "../utils/helpers.mjs";
5
+ const action = async ({ uuid, dependencies, all }) => {
6
+ const config = {
7
+ reportUUID: Boolean(all || uuid),
8
+ reportDependencies: Boolean(all || dependencies)
9
+ };
10
+ const appContext = await compileStrapi();
11
+ const app = await createStrapi(appContext).register();
12
+ let debugInfo = `Launched In: ${Date.now() - app.config.launchedAt} ms
13
+ Environment: ${app.config.environment}
14
+ OS: ${process.platform}-${process.arch}
15
+ Strapi Version: ${app.config.info.strapi}
16
+ Node/Yarn Version: ${process.env.npm_config_user_agent}
17
+ Edition: ${app.EE ? "Enterprise" : "Community"}
18
+ Database: ${app?.config?.database?.connection?.client ?? "unknown"}`;
19
+ if (config.reportUUID) {
20
+ debugInfo += `${EOL}UUID: ${app.config.uuid}`;
21
+ }
22
+ if (config.reportDependencies) {
23
+ debugInfo += `${EOL}Dependencies: ${JSON.stringify(app.config.info.dependencies, null, 2)}
24
+ Dev Dependencies: ${JSON.stringify(app.config.info.devDependencies, null, 2)}`;
25
+ }
26
+ console.log(debugInfo);
27
+ await app.destroy();
28
+ };
29
+ const command = () => {
30
+ return createCommand("report").description("Get system stats for debugging and submitting issues").option("-u, --uuid", "Include Project UUID").option("-d, --dependencies", "Include Project Dependencies").option("--all", "Include All Information").action(runAction("report", action));
31
+ };
32
+ export {
33
+ command
34
+ };
35
+ //# sourceMappingURL=report.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"report.mjs","sources":["../../../src/cli/commands/report.ts"],"sourcesContent":["import { createCommand } from 'commander';\nimport { EOL } from 'os';\nimport { createStrapi, compileStrapi } from '@strapi/core';\nimport type { StrapiCommand } from '../types';\nimport { runAction } from '../utils/helpers';\n\ninterface CmdOptions {\n uuid: boolean;\n dependencies: boolean;\n all: boolean;\n}\n\nconst action = async ({ uuid, dependencies, all }: CmdOptions) => {\n const config = {\n reportUUID: Boolean(all || uuid),\n reportDependencies: Boolean(all || dependencies),\n };\n\n const appContext = await compileStrapi();\n const app = await createStrapi(appContext).register();\n\n let debugInfo = `Launched In: ${Date.now() - app.config.launchedAt} ms\nEnvironment: ${app.config.environment}\nOS: ${process.platform}-${process.arch}\nStrapi Version: ${app.config.info.strapi}\nNode/Yarn Version: ${process.env.npm_config_user_agent}\nEdition: ${app.EE ? 'Enterprise' : 'Community'}\nDatabase: ${app?.config?.database?.connection?.client ?? 'unknown'}`;\n\n if (config.reportUUID) {\n debugInfo += `${EOL}UUID: ${app.config.uuid}`;\n }\n\n if (config.reportDependencies) {\n debugInfo += `${EOL}Dependencies: ${JSON.stringify(app.config.info.dependencies, null, 2)}\nDev Dependencies: ${JSON.stringify(app.config.info.devDependencies, null, 2)}`;\n }\n\n console.log(debugInfo);\n\n await app.destroy();\n};\n\n/**\n * `$ strapi report`\n */\nconst command: StrapiCommand = () => {\n return createCommand('report')\n .description('Get system stats for debugging and submitting issues')\n .option('-u, --uuid', 'Include Project UUID')\n .option('-d, --dependencies', 'Include Project Dependencies')\n .option('--all', 'Include All Information')\n .action(runAction('report', action));\n};\n\nexport { command };\n"],"names":[],"mappings":";;;;AAYA,MAAM,SAAS,OAAO,EAAE,MAAM,cAAc,UAAsB;AAChE,QAAM,SAAS;AAAA,IACb,YAAY,QAAQ,OAAO,IAAI;AAAA,IAC/B,oBAAoB,QAAQ,OAAO,YAAY;AAAA,EAAA;AAG3C,QAAA,aAAa,MAAM;AACzB,QAAM,MAAM,MAAM,aAAa,UAAU,EAAE,SAAS;AAEpD,MAAI,YAAY,gBAAgB,KAAK,QAAQ,IAAI,OAAO,UAAU;AAAA,eACrD,IAAI,OAAO,WAAW;AAAA,MAC/B,QAAQ,QAAQ,IAAI,QAAQ,IAAI;AAAA,kBACpB,IAAI,OAAO,KAAK,MAAM;AAAA,qBACnB,QAAQ,IAAI,qBAAqB;AAAA,WAC3C,IAAI,KAAK,eAAe,WAAW;AAAA,YAClC,KAAK,QAAQ,UAAU,YAAY,UAAU,SAAS;AAEhE,MAAI,OAAO,YAAY;AACrB,iBAAa,GAAG,GAAG,SAAS,IAAI,OAAO,IAAI;AAAA,EAC7C;AAEA,MAAI,OAAO,oBAAoB;AAChB,iBAAA,GAAG,GAAG,iBAAiB,KAAK,UAAU,IAAI,OAAO,KAAK,cAAc,MAAM,CAAC,CAAC;AAAA,oBACzE,KAAK,UAAU,IAAI,OAAO,KAAK,iBAAiB,MAAM,CAAC,CAAC;AAAA,EAC1E;AAEA,UAAQ,IAAI,SAAS;AAErB,QAAM,IAAI;AACZ;AAKA,MAAM,UAAyB,MAAM;AAC5B,SAAA,cAAc,QAAQ,EAC1B,YAAY,sDAAsD,EAClE,OAAO,cAAc,sBAAsB,EAC3C,OAAO,sBAAsB,8BAA8B,EAC3D,OAAO,SAAS,yBAAyB,EACzC,OAAO,UAAU,UAAU,MAAM,CAAC;AACvC;"}
@@ -10,8 +10,8 @@ const _interopDefault = (e) => e && e.__esModule ? e : { default: e };
10
10
  const CLITable__default = /* @__PURE__ */ _interopDefault(CLITable);
11
11
  const chalk__default = /* @__PURE__ */ _interopDefault(chalk);
12
12
  const action = async () => {
13
- const appContext = await core.strapiFactory.compile();
14
- const app = await core.strapiFactory(appContext).load();
13
+ const appContext = await core.compileStrapi();
14
+ const app = await core.createStrapi(appContext).load();
15
15
  const list = app.server.mount().listRoutes();
16
16
  const infoTable = new CLITable__default.default({
17
17
  head: [chalk__default.default.blue("Method"), chalk__default.default.blue("Path")],
@@ -1 +1 @@
1
- {"version":3,"file":"list.js","sources":["../../../../src/cli/commands/routes/list.ts"],"sourcesContent":["import { createCommand } from 'commander';\nimport CLITable from 'cli-table3';\nimport chalk from 'chalk';\nimport { toUpper } from 'lodash/fp';\n\nimport { strapiFactory } from '@strapi/core';\n\nimport type { StrapiCommand } from '../../types';\nimport { runAction } from '../../utils/helpers';\n\nconst action = async () => {\n const appContext = await strapiFactory.compile();\n const app = await strapiFactory(appContext).load();\n\n const list = app.server.mount().listRoutes();\n\n const infoTable = new CLITable({\n head: [chalk.blue('Method'), chalk.blue('Path')],\n colWidths: [20],\n });\n\n list\n .filter((route) => route.methods.length)\n .forEach((route) => {\n infoTable.push([route.methods.map(toUpper).join('|'), route.path]);\n });\n\n console.log(infoTable.toString());\n\n await app.destroy();\n};\n\n/**\n * `$ strapi routes:list``\n */\nconst command: StrapiCommand = () => {\n return createCommand('routes:list')\n .description('List all the application routes')\n .action(runAction('routes:list', action));\n};\n\nexport { action, command };\n"],"names":["strapiFactory","CLITable","chalk","toUpper","createCommand","runAction"],"mappings":";;;;;;;;;;;AAUA,MAAM,SAAS,YAAY;AACnB,QAAA,aAAa,MAAMA,mBAAc;AACvC,QAAM,MAAM,MAAMA,KAAAA,cAAc,UAAU,EAAE,KAAK;AAEjD,QAAM,OAAO,IAAI,OAAO,QAAQ,WAAW;AAErC,QAAA,YAAY,IAAIC,0BAAS;AAAA,IAC7B,MAAM,CAACC,eAAM,QAAA,KAAK,QAAQ,GAAGA,uBAAM,KAAK,MAAM,CAAC;AAAA,IAC/C,WAAW,CAAC,EAAE;AAAA,EAAA,CACf;AAGE,OAAA,OAAO,CAAC,UAAU,MAAM,QAAQ,MAAM,EACtC,QAAQ,CAAC,UAAU;AAClB,cAAU,KAAK,CAAC,MAAM,QAAQ,IAAIC,GAAAA,OAAO,EAAE,KAAK,GAAG,GAAG,MAAM,IAAI,CAAC;AAAA,EAAA,CAClE;AAEK,UAAA,IAAI,UAAU,SAAU,CAAA;AAEhC,QAAM,IAAI;AACZ;AAKA,MAAM,UAAyB,MAAM;AAC5B,SAAAC,wBAAc,aAAa,EAC/B,YAAY,iCAAiC,EAC7C,OAAOC,kBAAU,eAAe,MAAM,CAAC;AAC5C;;;"}
1
+ {"version":3,"file":"list.js","sources":["../../../../src/cli/commands/routes/list.ts"],"sourcesContent":["import { createCommand } from 'commander';\nimport CLITable from 'cli-table3';\nimport chalk from 'chalk';\nimport { toUpper } from 'lodash/fp';\n\nimport { createStrapi, compileStrapi } from '@strapi/core';\n\nimport type { StrapiCommand } from '../../types';\nimport { runAction } from '../../utils/helpers';\n\nconst action = async () => {\n const appContext = await compileStrapi();\n const app = await createStrapi(appContext).load();\n\n const list = app.server.mount().listRoutes();\n\n const infoTable = new CLITable({\n head: [chalk.blue('Method'), chalk.blue('Path')],\n colWidths: [20],\n });\n\n list\n .filter((route) => route.methods.length)\n .forEach((route) => {\n infoTable.push([route.methods.map(toUpper).join('|'), route.path]);\n });\n\n console.log(infoTable.toString());\n\n await app.destroy();\n};\n\n/**\n * `$ strapi routes:list``\n */\nconst command: StrapiCommand = () => {\n return createCommand('routes:list')\n .description('List all the application routes')\n .action(runAction('routes:list', action));\n};\n\nexport { action, command };\n"],"names":["compileStrapi","createStrapi","CLITable","chalk","toUpper","createCommand","runAction"],"mappings":";;;;;;;;;;;AAUA,MAAM,SAAS,YAAY;AACnB,QAAA,aAAa,MAAMA,KAAAA;AACzB,QAAM,MAAM,MAAMC,KAAAA,aAAa,UAAU,EAAE,KAAK;AAEhD,QAAM,OAAO,IAAI,OAAO,QAAQ,WAAW;AAErC,QAAA,YAAY,IAAIC,0BAAS;AAAA,IAC7B,MAAM,CAACC,eAAM,QAAA,KAAK,QAAQ,GAAGA,uBAAM,KAAK,MAAM,CAAC;AAAA,IAC/C,WAAW,CAAC,EAAE;AAAA,EAAA,CACf;AAGE,OAAA,OAAO,CAAC,UAAU,MAAM,QAAQ,MAAM,EACtC,QAAQ,CAAC,UAAU;AAClB,cAAU,KAAK,CAAC,MAAM,QAAQ,IAAIC,GAAAA,OAAO,EAAE,KAAK,GAAG,GAAG,MAAM,IAAI,CAAC;AAAA,EAAA,CAClE;AAEK,UAAA,IAAI,UAAU,SAAU,CAAA;AAEhC,QAAM,IAAI;AACZ;AAKA,MAAM,UAAyB,MAAM;AAC5B,SAAAC,wBAAc,aAAa,EAC/B,YAAY,iCAAiC,EAC7C,OAAOC,kBAAU,eAAe,MAAM,CAAC;AAC5C;;;"}
@@ -0,0 +1,28 @@
1
+ import { createCommand } from "commander";
2
+ import CLITable from "cli-table3";
3
+ import chalk from "chalk";
4
+ import { toUpper } from "lodash/fp";
5
+ import { compileStrapi, createStrapi } from "@strapi/core";
6
+ import { runAction } from "../../utils/helpers.mjs";
7
+ const action = async () => {
8
+ const appContext = await compileStrapi();
9
+ const app = await createStrapi(appContext).load();
10
+ const list = app.server.mount().listRoutes();
11
+ const infoTable = new CLITable({
12
+ head: [chalk.blue("Method"), chalk.blue("Path")],
13
+ colWidths: [20]
14
+ });
15
+ list.filter((route) => route.methods.length).forEach((route) => {
16
+ infoTable.push([route.methods.map(toUpper).join("|"), route.path]);
17
+ });
18
+ console.log(infoTable.toString());
19
+ await app.destroy();
20
+ };
21
+ const command = () => {
22
+ return createCommand("routes:list").description("List all the application routes").action(runAction("routes:list", action));
23
+ };
24
+ export {
25
+ action,
26
+ command
27
+ };
28
+ //# sourceMappingURL=list.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"list.mjs","sources":["../../../../src/cli/commands/routes/list.ts"],"sourcesContent":["import { createCommand } from 'commander';\nimport CLITable from 'cli-table3';\nimport chalk from 'chalk';\nimport { toUpper } from 'lodash/fp';\n\nimport { createStrapi, compileStrapi } from '@strapi/core';\n\nimport type { StrapiCommand } from '../../types';\nimport { runAction } from '../../utils/helpers';\n\nconst action = async () => {\n const appContext = await compileStrapi();\n const app = await createStrapi(appContext).load();\n\n const list = app.server.mount().listRoutes();\n\n const infoTable = new CLITable({\n head: [chalk.blue('Method'), chalk.blue('Path')],\n colWidths: [20],\n });\n\n list\n .filter((route) => route.methods.length)\n .forEach((route) => {\n infoTable.push([route.methods.map(toUpper).join('|'), route.path]);\n });\n\n console.log(infoTable.toString());\n\n await app.destroy();\n};\n\n/**\n * `$ strapi routes:list``\n */\nconst command: StrapiCommand = () => {\n return createCommand('routes:list')\n .description('List all the application routes')\n .action(runAction('routes:list', action));\n};\n\nexport { action, command };\n"],"names":[],"mappings":";;;;;;AAUA,MAAM,SAAS,YAAY;AACnB,QAAA,aAAa,MAAM;AACzB,QAAM,MAAM,MAAM,aAAa,UAAU,EAAE,KAAK;AAEhD,QAAM,OAAO,IAAI,OAAO,QAAQ,WAAW;AAErC,QAAA,YAAY,IAAI,SAAS;AAAA,IAC7B,MAAM,CAAC,MAAM,KAAK,QAAQ,GAAG,MAAM,KAAK,MAAM,CAAC;AAAA,IAC/C,WAAW,CAAC,EAAE;AAAA,EAAA,CACf;AAGE,OAAA,OAAO,CAAC,UAAU,MAAM,QAAQ,MAAM,EACtC,QAAQ,CAAC,UAAU;AAClB,cAAU,KAAK,CAAC,MAAM,QAAQ,IAAI,OAAO,EAAE,KAAK,GAAG,GAAG,MAAM,IAAI,CAAC;AAAA,EAAA,CAClE;AAEK,UAAA,IAAI,UAAU,SAAU,CAAA;AAEhC,QAAM,IAAI;AACZ;AAKA,MAAM,UAAyB,MAAM;AAC5B,SAAA,cAAc,aAAa,EAC/B,YAAY,iCAAiC,EAC7C,OAAO,UAAU,eAAe,MAAM,CAAC;AAC5C;"}
@@ -9,8 +9,8 @@ const _interopDefault = (e) => e && e.__esModule ? e : { default: e };
9
9
  const CLITable__default = /* @__PURE__ */ _interopDefault(CLITable);
10
10
  const chalk__default = /* @__PURE__ */ _interopDefault(chalk);
11
11
  const action = async () => {
12
- const appContext = await core.strapiFactory.compile();
13
- const app = await core.strapiFactory(appContext).register();
12
+ const appContext = await core.compileStrapi();
13
+ const app = await core.createStrapi(appContext).register();
14
14
  const list = app.get("services").keys();
15
15
  const infoTable = new CLITable__default.default({
16
16
  head: [chalk__default.default.blue("Name")]
@@ -1 +1 @@
1
- {"version":3,"file":"list.js","sources":["../../../../src/cli/commands/services/list.ts"],"sourcesContent":["import { createCommand } from 'commander';\nimport CLITable from 'cli-table3';\nimport chalk from 'chalk';\nimport { strapiFactory } from '@strapi/core';\n\nimport type { StrapiCommand } from '../../types';\nimport { runAction } from '../../utils/helpers';\n\nconst action = async () => {\n const appContext = await strapiFactory.compile();\n const app = await strapiFactory(appContext).register();\n\n const list = app.get('services').keys();\n\n const infoTable = new CLITable({\n head: [chalk.blue('Name')],\n });\n\n list.forEach((name: string) => infoTable.push([name]));\n\n console.log(infoTable.toString());\n\n await app.destroy();\n};\n\n/**\n * `$ strapi services:list`\n */\nconst command: StrapiCommand = () => {\n return createCommand('services:list')\n .description('List all the application services')\n .action(runAction('services:list', action));\n};\n\nexport { action, command };\n"],"names":["strapiFactory","CLITable","chalk","createCommand","runAction"],"mappings":";;;;;;;;;;AAQA,MAAM,SAAS,YAAY;AACnB,QAAA,aAAa,MAAMA,mBAAc;AACvC,QAAM,MAAM,MAAMA,KAAAA,cAAc,UAAU,EAAE,SAAS;AAErD,QAAM,OAAO,IAAI,IAAI,UAAU,EAAE,KAAK;AAEhC,QAAA,YAAY,IAAIC,0BAAS;AAAA,IAC7B,MAAM,CAACC,eAAAA,QAAM,KAAK,MAAM,CAAC;AAAA,EAAA,CAC1B;AAEI,OAAA,QAAQ,CAAC,SAAiB,UAAU,KAAK,CAAC,IAAI,CAAC,CAAC;AAE7C,UAAA,IAAI,UAAU,SAAU,CAAA;AAEhC,QAAM,IAAI;AACZ;AAKA,MAAM,UAAyB,MAAM;AAC5B,SAAAC,wBAAc,eAAe,EACjC,YAAY,mCAAmC,EAC/C,OAAOC,kBAAU,iBAAiB,MAAM,CAAC;AAC9C;;;"}
1
+ {"version":3,"file":"list.js","sources":["../../../../src/cli/commands/services/list.ts"],"sourcesContent":["import { createCommand } from 'commander';\nimport CLITable from 'cli-table3';\nimport chalk from 'chalk';\nimport { createStrapi, compileStrapi } from '@strapi/core';\n\nimport type { StrapiCommand } from '../../types';\nimport { runAction } from '../../utils/helpers';\n\nconst action = async () => {\n const appContext = await compileStrapi();\n const app = await createStrapi(appContext).register();\n\n const list = app.get('services').keys();\n\n const infoTable = new CLITable({\n head: [chalk.blue('Name')],\n });\n\n list.forEach((name: string) => infoTable.push([name]));\n\n console.log(infoTable.toString());\n\n await app.destroy();\n};\n\n/**\n * `$ strapi services:list`\n */\nconst command: StrapiCommand = () => {\n return createCommand('services:list')\n .description('List all the application services')\n .action(runAction('services:list', action));\n};\n\nexport { action, command };\n"],"names":["compileStrapi","createStrapi","CLITable","chalk","createCommand","runAction"],"mappings":";;;;;;;;;;AAQA,MAAM,SAAS,YAAY;AACnB,QAAA,aAAa,MAAMA,KAAAA;AACzB,QAAM,MAAM,MAAMC,KAAAA,aAAa,UAAU,EAAE,SAAS;AAEpD,QAAM,OAAO,IAAI,IAAI,UAAU,EAAE,KAAK;AAEhC,QAAA,YAAY,IAAIC,0BAAS;AAAA,IAC7B,MAAM,CAACC,eAAAA,QAAM,KAAK,MAAM,CAAC;AAAA,EAAA,CAC1B;AAEI,OAAA,QAAQ,CAAC,SAAiB,UAAU,KAAK,CAAC,IAAI,CAAC,CAAC;AAE7C,UAAA,IAAI,UAAU,SAAU,CAAA;AAEhC,QAAM,IAAI;AACZ;AAKA,MAAM,UAAyB,MAAM;AAC5B,SAAAC,wBAAc,eAAe,EACjC,YAAY,mCAAmC,EAC/C,OAAOC,kBAAU,iBAAiB,MAAM,CAAC;AAC9C;;;"}
@@ -0,0 +1,24 @@
1
+ import { createCommand } from "commander";
2
+ import CLITable from "cli-table3";
3
+ import chalk from "chalk";
4
+ import { compileStrapi, createStrapi } from "@strapi/core";
5
+ import { runAction } from "../../utils/helpers.mjs";
6
+ const action = async () => {
7
+ const appContext = await compileStrapi();
8
+ const app = await createStrapi(appContext).register();
9
+ const list = app.get("services").keys();
10
+ const infoTable = new CLITable({
11
+ head: [chalk.blue("Name")]
12
+ });
13
+ list.forEach((name) => infoTable.push([name]));
14
+ console.log(infoTable.toString());
15
+ await app.destroy();
16
+ };
17
+ const command = () => {
18
+ return createCommand("services:list").description("List all the application services").action(runAction("services:list", action));
19
+ };
20
+ export {
21
+ action,
22
+ command
23
+ };
24
+ //# sourceMappingURL=list.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"list.mjs","sources":["../../../../src/cli/commands/services/list.ts"],"sourcesContent":["import { createCommand } from 'commander';\nimport CLITable from 'cli-table3';\nimport chalk from 'chalk';\nimport { createStrapi, compileStrapi } from '@strapi/core';\n\nimport type { StrapiCommand } from '../../types';\nimport { runAction } from '../../utils/helpers';\n\nconst action = async () => {\n const appContext = await compileStrapi();\n const app = await createStrapi(appContext).register();\n\n const list = app.get('services').keys();\n\n const infoTable = new CLITable({\n head: [chalk.blue('Name')],\n });\n\n list.forEach((name: string) => infoTable.push([name]));\n\n console.log(infoTable.toString());\n\n await app.destroy();\n};\n\n/**\n * `$ strapi services:list`\n */\nconst command: StrapiCommand = () => {\n return createCommand('services:list')\n .description('List all the application services')\n .action(runAction('services:list', action));\n};\n\nexport { action, command };\n"],"names":[],"mappings":";;;;;AAQA,MAAM,SAAS,YAAY;AACnB,QAAA,aAAa,MAAM;AACzB,QAAM,MAAM,MAAM,aAAa,UAAU,EAAE,SAAS;AAEpD,QAAM,OAAO,IAAI,IAAI,UAAU,EAAE,KAAK;AAEhC,QAAA,YAAY,IAAI,SAAS;AAAA,IAC7B,MAAM,CAAC,MAAM,KAAK,MAAM,CAAC;AAAA,EAAA,CAC1B;AAEI,OAAA,QAAQ,CAAC,SAAiB,UAAU,KAAK,CAAC,IAAI,CAAC,CAAC;AAE7C,UAAA,IAAI,UAAU,SAAU,CAAA;AAEhC,QAAM,IAAI;AACZ;AAKA,MAAM,UAAyB,MAAM;AAC5B,SAAA,cAAc,eAAe,EACjC,YAAY,mCAAmC,EAC/C,OAAO,UAAU,iBAAiB,MAAM,CAAC;AAC9C;"}
@@ -18,7 +18,7 @@ const action = async () => {
18
18
  throw new Error(
19
19
  `${outDir} directory not found. Please run the build command before starting your application`
20
20
  );
21
- core.strapiFactory({ appDir, distDir }).start();
21
+ core.createStrapi({ appDir, distDir }).start();
22
22
  };
23
23
  const command = () => {
24
24
  return commander.createCommand("start").description("Start your Strapi application").action(helpers.runAction("start", action));
@@ -1 +1 @@
1
- {"version":3,"file":"start.js","sources":["../../../src/cli/commands/start.ts"],"sourcesContent":["import { createCommand } from 'commander';\nimport fs from 'fs';\nimport tsUtils from '@strapi/typescript-utils';\nimport { strapiFactory } from '@strapi/core';\n\nimport type { StrapiCommand } from '../types';\nimport { runAction } from '../utils/helpers';\n\nconst action = async () => {\n const appDir = process.cwd();\n\n const isTSProject = await tsUtils.isUsingTypeScript(appDir);\n\n const outDir = await tsUtils.resolveOutDir(appDir);\n const distDir = isTSProject ? outDir : appDir;\n\n const buildDirExists = fs.existsSync(outDir);\n if (isTSProject && !buildDirExists)\n throw new Error(\n `${outDir} directory not found. Please run the build command before starting your application`\n );\n\n strapiFactory({ appDir, distDir }).start();\n};\n\n/**\n * `$ strapi start`\n */\nconst command: StrapiCommand = () => {\n return createCommand('start')\n .description('Start your Strapi application')\n .action(runAction('start', action));\n};\n\nexport { command };\n"],"names":["tsUtils","fs","strapiFactory","createCommand","runAction"],"mappings":";;;;;;;;;;AAQA,MAAM,SAAS,YAAY;AACnB,QAAA,SAAS,QAAQ;AAEvB,QAAM,cAAc,MAAMA,iBAAAA,QAAQ,kBAAkB,MAAM;AAE1D,QAAM,SAAS,MAAMA,iBAAAA,QAAQ,cAAc,MAAM;AAC3C,QAAA,UAAU,cAAc,SAAS;AAEjC,QAAA,iBAAiBC,YAAAA,QAAG,WAAW,MAAM;AAC3C,MAAI,eAAe,CAAC;AAClB,UAAM,IAAI;AAAA,MACR,GAAG,MAAM;AAAA,IAAA;AAGbC,OAAAA,cAAc,EAAE,QAAQ,QAAQ,CAAC,EAAE,MAAM;AAC3C;AAKA,MAAM,UAAyB,MAAM;AAC5B,SAAAC,wBAAc,OAAO,EACzB,YAAY,+BAA+B,EAC3C,OAAOC,kBAAU,SAAS,MAAM,CAAC;AACtC;;"}
1
+ {"version":3,"file":"start.js","sources":["../../../src/cli/commands/start.ts"],"sourcesContent":["import { createCommand } from 'commander';\nimport fs from 'fs';\nimport tsUtils from '@strapi/typescript-utils';\nimport { createStrapi } from '@strapi/core';\n\nimport type { StrapiCommand } from '../types';\nimport { runAction } from '../utils/helpers';\n\nconst action = async () => {\n const appDir = process.cwd();\n\n const isTSProject = await tsUtils.isUsingTypeScript(appDir);\n\n const outDir = await tsUtils.resolveOutDir(appDir);\n const distDir = isTSProject ? outDir : appDir;\n\n const buildDirExists = fs.existsSync(outDir);\n if (isTSProject && !buildDirExists)\n throw new Error(\n `${outDir} directory not found. Please run the build command before starting your application`\n );\n\n createStrapi({ appDir, distDir }).start();\n};\n\n/**\n * `$ strapi start`\n */\nconst command: StrapiCommand = () => {\n return createCommand('start')\n .description('Start your Strapi application')\n .action(runAction('start', action));\n};\n\nexport { command };\n"],"names":["tsUtils","fs","createStrapi","createCommand","runAction"],"mappings":";;;;;;;;;;AAQA,MAAM,SAAS,YAAY;AACnB,QAAA,SAAS,QAAQ;AAEvB,QAAM,cAAc,MAAMA,iBAAAA,QAAQ,kBAAkB,MAAM;AAE1D,QAAM,SAAS,MAAMA,iBAAAA,QAAQ,cAAc,MAAM;AAC3C,QAAA,UAAU,cAAc,SAAS;AAEjC,QAAA,iBAAiBC,YAAAA,QAAG,WAAW,MAAM;AAC3C,MAAI,eAAe,CAAC;AAClB,UAAM,IAAI;AAAA,MACR,GAAG,MAAM;AAAA,IAAA;AAGbC,OAAAA,aAAa,EAAE,QAAQ,QAAQ,CAAC,EAAE,MAAM;AAC1C;AAKA,MAAM,UAAyB,MAAM;AAC5B,SAAAC,wBAAc,OAAO,EACzB,YAAY,+BAA+B,EAC3C,OAAOC,kBAAU,SAAS,MAAM,CAAC;AACtC;;"}
@@ -0,0 +1,24 @@
1
+ import { createCommand } from "commander";
2
+ import fs from "fs";
3
+ import tsUtils__default from "@strapi/typescript-utils";
4
+ import { createStrapi } from "@strapi/core";
5
+ import { runAction } from "../utils/helpers.mjs";
6
+ const action = async () => {
7
+ const appDir = process.cwd();
8
+ const isTSProject = await tsUtils__default.isUsingTypeScript(appDir);
9
+ const outDir = await tsUtils__default.resolveOutDir(appDir);
10
+ const distDir = isTSProject ? outDir : appDir;
11
+ const buildDirExists = fs.existsSync(outDir);
12
+ if (isTSProject && !buildDirExists)
13
+ throw new Error(
14
+ `${outDir} directory not found. Please run the build command before starting your application`
15
+ );
16
+ createStrapi({ appDir, distDir }).start();
17
+ };
18
+ const command = () => {
19
+ return createCommand("start").description("Start your Strapi application").action(runAction("start", action));
20
+ };
21
+ export {
22
+ command
23
+ };
24
+ //# sourceMappingURL=start.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"start.mjs","sources":["../../../src/cli/commands/start.ts"],"sourcesContent":["import { createCommand } from 'commander';\nimport fs from 'fs';\nimport tsUtils from '@strapi/typescript-utils';\nimport { createStrapi } from '@strapi/core';\n\nimport type { StrapiCommand } from '../types';\nimport { runAction } from '../utils/helpers';\n\nconst action = async () => {\n const appDir = process.cwd();\n\n const isTSProject = await tsUtils.isUsingTypeScript(appDir);\n\n const outDir = await tsUtils.resolveOutDir(appDir);\n const distDir = isTSProject ? outDir : appDir;\n\n const buildDirExists = fs.existsSync(outDir);\n if (isTSProject && !buildDirExists)\n throw new Error(\n `${outDir} directory not found. Please run the build command before starting your application`\n );\n\n createStrapi({ appDir, distDir }).start();\n};\n\n/**\n * `$ strapi start`\n */\nconst command: StrapiCommand = () => {\n return createCommand('start')\n .description('Start your Strapi application')\n .action(runAction('start', action));\n};\n\nexport { command };\n"],"names":["tsUtils"],"mappings":";;;;;AAQA,MAAM,SAAS,YAAY;AACnB,QAAA,SAAS,QAAQ;AAEvB,QAAM,cAAc,MAAMA,iBAAQ,kBAAkB,MAAM;AAE1D,QAAM,SAAS,MAAMA,iBAAQ,cAAc,MAAM;AAC3C,QAAA,UAAU,cAAc,SAAS;AAEjC,QAAA,iBAAiB,GAAG,WAAW,MAAM;AAC3C,MAAI,eAAe,CAAC;AAClB,UAAM,IAAI;AAAA,MACR,GAAG,MAAM;AAAA,IAAA;AAGb,eAAa,EAAE,QAAQ,QAAQ,CAAC,EAAE,MAAM;AAC1C;AAKA,MAAM,UAAyB,MAAM;AAC5B,SAAA,cAAc,OAAO,EACzB,YAAY,+BAA+B,EAC3C,OAAO,UAAU,SAAS,MAAM,CAAC;AACtC;"}
@@ -0,0 +1,67 @@
1
+ import { resolve } from "path";
2
+ import fse from "fs-extra";
3
+ import chalk from "chalk";
4
+ import { createCommand } from "commander";
5
+ import { runAction } from "../../utils/helpers.mjs";
6
+ import { sendEvent } from "../../utils/telemetry.mjs";
7
+ const readPackageJSON = async (path) => {
8
+ try {
9
+ const packageObj = await fse.readJson(path);
10
+ const uuid = packageObj.strapi ? packageObj.strapi.uuid : null;
11
+ return { uuid, packageObj };
12
+ } catch (err) {
13
+ if (err instanceof Error) {
14
+ console.error(`${chalk.red("Error")}: ${err.message}`);
15
+ }
16
+ }
17
+ };
18
+ const writePackageJSON = async (path, file, spacing) => {
19
+ try {
20
+ await fse.writeJson(path, file, { spaces: spacing });
21
+ return true;
22
+ } catch (err) {
23
+ if (err instanceof Error) {
24
+ console.error(`${chalk.red("Error")}: ${err.message}`);
25
+ }
26
+ }
27
+ };
28
+ const action = async () => {
29
+ const packageJSONPath = resolve(process.cwd(), "package.json");
30
+ const exists = await fse.pathExists(packageJSONPath);
31
+ if (!exists) {
32
+ console.log(`${chalk.yellow("Warning")}: could not find package.json`);
33
+ process.exit(0);
34
+ }
35
+ const { uuid, packageObj } = await readPackageJSON(packageJSONPath) ?? {};
36
+ if (packageObj.strapi && packageObj.strapi.telemetryDisabled || !uuid) {
37
+ console.log(`${chalk.yellow("Warning:")} telemetry is already disabled`);
38
+ process.exit(0);
39
+ }
40
+ const updatedPackageJSON = {
41
+ ...packageObj,
42
+ strapi: {
43
+ ...packageObj.strapi,
44
+ telemetryDisabled: true
45
+ }
46
+ };
47
+ const write = await writePackageJSON(packageJSONPath, updatedPackageJSON, 2);
48
+ if (!write) {
49
+ console.log(
50
+ `${chalk.yellow(
51
+ "Warning"
52
+ )}: There has been an error, please set "telemetryDisabled": true in the "strapi" object of your package.json manually.`
53
+ );
54
+ process.exit(0);
55
+ }
56
+ await sendEvent("didOptOutTelemetry", uuid);
57
+ console.log(`${chalk.green("Successfully opted out of Strapi telemetry")}`);
58
+ process.exit(0);
59
+ };
60
+ const command = () => {
61
+ return createCommand("telemetry:disable").description("Disable anonymous telemetry and metadata sending to Strapi analytics").action(runAction("telemetry:disable", action));
62
+ };
63
+ export {
64
+ action,
65
+ command
66
+ };
67
+ //# sourceMappingURL=disable.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"disable.mjs","sources":["../../../../src/cli/commands/telemetry/disable.ts"],"sourcesContent":["import { resolve } from 'path';\nimport fse from 'fs-extra';\nimport chalk from 'chalk';\nimport { createCommand } from 'commander';\n\nimport type { StrapiCommand } from '../../types';\nimport { runAction } from '../../utils/helpers';\nimport { sendEvent } from '../../utils/telemetry';\n\nconst readPackageJSON = async (path: string) => {\n try {\n const packageObj = await fse.readJson(path);\n const uuid = packageObj.strapi ? packageObj.strapi.uuid : null;\n\n return { uuid, packageObj };\n } catch (err) {\n if (err instanceof Error) {\n console.error(`${chalk.red('Error')}: ${err.message}`);\n }\n }\n};\n\nconst writePackageJSON = async (path: string, file: object, spacing: number) => {\n try {\n await fse.writeJson(path, file, { spaces: spacing });\n return true;\n } catch (err) {\n if (err instanceof Error) {\n console.error(`${chalk.red('Error')}: ${err.message}`);\n }\n }\n};\n\nconst action = async () => {\n const packageJSONPath = resolve(process.cwd(), 'package.json');\n const exists = await fse.pathExists(packageJSONPath);\n\n if (!exists) {\n console.log(`${chalk.yellow('Warning')}: could not find package.json`);\n process.exit(0);\n }\n\n const { uuid, packageObj } = (await readPackageJSON(packageJSONPath)) ?? {};\n\n if ((packageObj.strapi && packageObj.strapi.telemetryDisabled) || !uuid) {\n console.log(`${chalk.yellow('Warning:')} telemetry is already disabled`);\n process.exit(0);\n }\n\n const updatedPackageJSON = {\n ...packageObj,\n strapi: {\n ...packageObj.strapi,\n telemetryDisabled: true,\n },\n };\n\n const write = await writePackageJSON(packageJSONPath, updatedPackageJSON, 2);\n\n if (!write) {\n console.log(\n `${chalk.yellow(\n 'Warning'\n )}: There has been an error, please set \"telemetryDisabled\": true in the \"strapi\" object of your package.json manually.`\n );\n process.exit(0);\n }\n\n await sendEvent('didOptOutTelemetry', uuid);\n console.log(`${chalk.green('Successfully opted out of Strapi telemetry')}`);\n process.exit(0);\n};\n\n/**\n * `$ strapi telemetry:disable`\n */\nconst command: StrapiCommand = () => {\n return createCommand('telemetry:disable')\n .description('Disable anonymous telemetry and metadata sending to Strapi analytics')\n .action(runAction('telemetry:disable', action));\n};\n\nexport { action, command };\n"],"names":[],"mappings":";;;;;;AASA,MAAM,kBAAkB,OAAO,SAAiB;AAC1C,MAAA;AACF,UAAM,aAAa,MAAM,IAAI,SAAS,IAAI;AAC1C,UAAM,OAAO,WAAW,SAAS,WAAW,OAAO,OAAO;AAEnD,WAAA,EAAE,MAAM;WACR,KAAK;AACZ,QAAI,eAAe,OAAO;AAChB,cAAA,MAAM,GAAG,MAAM,IAAI,OAAO,CAAC,KAAK,IAAI,OAAO,EAAE;AAAA,IACvD;AAAA,EACF;AACF;AAEA,MAAM,mBAAmB,OAAO,MAAc,MAAc,YAAoB;AAC1E,MAAA;AACF,UAAM,IAAI,UAAU,MAAM,MAA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omUUID } from "crypto";
3
+ import fse from "fs-extra";
4
+ import chalk from "chalk";
5
+ import { createCommand } from "commander";
6
+ import { runAction } from "../../utils/helpers.mjs";
7
+ import { sendEvent } from "../../utils/telemetry.mjs";
8
+ const readPackageJSON = async (path) => {
9
+ try {
10
+ const packageObj = await fse.readJson(path);
11
+ return packageObj;
12
+ } catch (err) {
13
+ if (err instanceof Error) {
14
+ console.error(`${chalk.red("Error")}: ${err.message}`);
15
+ } else {
16
+ throw err;
17
+ }
18
+ }
19
+ };
20
+ const writePackageJSON = async (path, file, spacing) => {
21
+ try {
22
+ await fse.writeJson(path, file, { spaces: spacing });
23
+ return true;
24
+ } catch (err) {
25
+ if (err instanceof Error) {
26
+ console.error(`${chalk.red("Error")}: ${err.message}`);
27
+ console.log(
28
+ `${chalk.yellow(
29
+ "Warning"
30
+ )}: There has been an error, please set "telemetryDisabled": false in the "strapi" object of your package.json manually.`
31
+ );
32
+ return false;
33
+ }
34
+ throw err;
35
+ }
36
+ };
37
+ const generateNewPackageJSON = (packageObj) => {
38
+ if (!packageObj.strapi) {
39
+ return {
40
+ ...packageObj,
41
+ strapi: {
42
+ uuid: randomUUID(),
43
+ telemetryDisabled: false
44
+ }
45
+ };
46
+ }
47
+ return {
48
+ ...packageObj,
49
+ strapi: {
50
+ ...packageObj.strapi,
51
+ uuid: packageObj.strapi.uuid ? packageObj.strapi.uuid : randomUUID(),
52
+ telemetryDisabled: false
53
+ }
54
+ };
55
+ };
56
+ const action = async () => {
57
+ const packageJSONPath = resolve(process.cwd(), "package.json");
58
+ const exists = await fse.pathExists(packageJSONPath);
59
+ if (!exists) {
60
+ console.log(`${chalk.yellow("Warning")}: could not find package.json`);
61
+ process.exit(0);
62
+ }
63
+ const packageObj = await readPackageJSON(packageJSONPath);
64
+ if (packageObj.strapi && packageObj.strapi.uuid) {
65
+ if (packageObj.strapi.telemetryDisabled === false) {
66
+ console.log(`${chalk.yellow("Warning:")} telemetry is already enabled`);
67
+ process.exit(0);
68
+ }
69
+ }
70
+ const updatedPackageJSON = generateNewPackageJSON(packageObj);
71
+ const write = await writePackageJSON(packageJSONPath, updatedPackageJSON, 2);
72
+ if (!write) {
73
+ process.exit(0);
74
+ }
75
+ await sendEvent("didOptInTelemetry", updatedPackageJSON.strapi.uuid);
76
+ console.log(`${chalk.green("Successfully opted into and enabled Strapi telemetry")}`);
77
+ process.exit(0);
78
+ };
79
+ const command = () => {
80
+ return createCommand("telemetry:enable").description("Enable anonymous telemetry and metadata sending to Strapi analytics").action(runAction("telemetry:enable", action));
81
+ };
82
+ export {
83
+ action,
84
+ command
85
+ };
86
+ //# sourceMappingURL=enable.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"enable.mjs","sources":["../../../../src/cli/commands/telemetry/enable.ts"],"sourcesContent":["import { resolve } from 'path';\nimport { randomUUID } from 'crypto';\nimport fse from 'fs-extra';\nimport chalk from 'chalk';\nimport { createCommand } from 'commander';\n\nimport type { StrapiCommand } from '../../types';\nimport { runAction } from '../../utils/helpers';\nimport { sendEvent } from '../../utils/telemetry';\n\ntype PackageJson = {\n strapi?: {\n uuid?: string;\n telemetryDisabled?: boolean;\n };\n};\n\nconst readPackageJSON = async (path: string) => {\n try {\n const packageObj = await fse.readJson(path);\n return packageObj;\n } catch (err) {\n if (err instanceof Error) {\n console.error(`${chalk.red('Error')}: ${err.message}`);\n } else {\n throw err;\n }\n }\n};\n\nconst writePackageJSON = async (path: string, file: object, spacing: number) => {\n try {\n await fse.writeJson(path, file, { spaces: spacing });\n return true;\n } catch (err) {\n if (err instanceof Error) {\n console.error(`${chalk.red('Error')}: ${err.message}`);\n console.log(\n `${chalk.yellow(\n 'Warning'\n )}: There has been an error, please set \"telemetryDisabled\": false in the \"strapi\" object of your package.json manually.`\n );\n\n return false;\n }\n\n throw err;\n }\n};\n\nconst generateNewPackageJSON = (packageObj: PackageJson) => {\n if (!packageObj.strapi) {\n return {\n ...packageObj,\n strapi: {\n uuid: randomUUID(),\n telemetryDisabled: false,\n },\n };\n }\n return {\n ...packageObj,\n strapi: {\n ...packageObj.strapi,\n uuid: packageObj.strapi.uuid ? packageObj.strapi.uuid : randomUUID(),\n telemetryDisabled: false,\n },\n };\n};\n\nconst action = async () => {\n const packageJSONPath = resolve(process.cwd(), 'package.json');\n const exists = await fse.pathExists(packageJSONPath);\n\n if (!exists) {\n console.log(`${chalk.yellow('Warning')}: could not find package.json`);\n process.exit(0);\n }\n\n const packageObj = await readPackageJSON(packageJSONPath);\n\n if (packageObj.strapi && packageObj.strapi.uuid) {\n if (packageObj.strapi.telemetryDisabled === false) {\n console.log(`${chalk.yellow('Warning:')} telemetry is already enabled`);\n process.exit(0);\n }\n }\n\n const updatedPackageJSON = generateNewPackageJSON(packageObj);\n\n const write = await writePackageJSON(packageJSONPath, updatedPackageJSON, 2);\n\n if (!write) {\n process.exit(0);\n }\n\n await sendEvent('didOptInTelemetry', updatedPackageJSON.strapi.uuid);\n console.log(`${chalk.green('Successfully opted into and enabled Strapi telemetry')}`);\n process.exit(0);\n};\n\n/**\n * `$ strapi telemetry:enable`\n */\nconst command: StrapiCommand = () => {\n return createCommand('telemetry:enable')\n .description('Enable anonymous telemetry and metadata sending to Strapi analytics')\n .action(runAction('telemetry:enable', action));\n};\n\nexport { action, command };\n"],"names":[],"mappings":";;;;;;;AAiBA,MAAM,kBAAkB,OAAO,SAAiB;AAC1C,MAAA;AACF,UAAM,aAAa,MAAM,IAAI,SAAS,IAAI;AACnC,WAAA;AAAA,WACA,KAAK;AACZ,QAAI,eAAe,OAAO;AAChB,cAAA,MAAM,GAAG,MAAM,IAAI,OAAO,CAAC,KAAK,IAAI,OAAO,EAAE;AAAA,IAAA,OAChD;AACC,YAAA;AAAA,IACR;AAAA,EACF;AACF;AAEA,MAAM,mBAAmB,OAAO,MAAc,MAAc,YAAoB;AAC1E,MAAA;AACF,UAAM,IAAI,UAAU,MAAM,MAAM,EAAE,QAAQ,SAAS;AAC5C,WAAA;AAAA,WACA,KAAK;AACZ,QAAI,eA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O,IAAI;AACnE,UAAQ,IAAI,GAAG,MAAM,MAAM,sDAAsD,CAAC,EAAE;AACpF,UAAQ,KAAK,CAAC;AAChB;AAKA,MAAM,UAAyB,MAAM;AAC5B,SAAA,cAAc,kBAAkB,EACpC,YAAY,qEAAqE,EACjF,OAAO,UAAU,oBAAoB,MAAM,CAAC;AACjD;"}
@@ -0,0 +1,74 @@
1
+ import { createCommand } from "commander";
2
+ import { resolve, join, basename } from "path";
3
+ import fse from "fs-extra";
4
+ import chalk from "chalk";
5
+ import inquirer from "inquirer";
6
+ import { runAction } from "../../utils/helpers.mjs";
7
+ const TEMPLATE_CONTENT = ["src", "data"];
8
+ async function copyContent(templatePath, rootBase) {
9
+ for (const item of TEMPLATE_CONTENT) {
10
+ try {
11
+ const pathToCopy = join(process.cwd(), item);
12
+ if (!await fse.pathExists(pathToCopy)) {
13
+ continue;
14
+ }
15
+ await fse.copy(pathToCopy, join(templatePath, item));
16
+ const currentProjectBase = basename(process.cwd());
17
+ console.log(
18
+ `${chalk.green(
19
+ "success"
20
+ )}: copy ${currentProjectBase}/${item} => ${rootBase}/template/${item}`
21
+ );
22
+ } catch (error) {
23
+ if (error instanceof Error) {
24
+ console.error(`${chalk.red("error")}: ${error.message}`);
25
+ }
26
+ }
27
+ }
28
+ }
29
+ async function writeTemplateJson(rootPath) {
30
+ try {
31
+ await fse.writeJSON(join(rootPath, "template.json"), {});
32
+ console.log(`${chalk.green("success")}: create JSON config file`);
33
+ } catch (error) {
34
+ if (error instanceof Error) {
35
+ console.error(`${chalk.red("error")}: ${error.message}`);
36
+ }
37
+ }
38
+ }
39
+ async function templateConfigExists(rootPath) {
40
+ const configExists = await fse.pathExists(join(rootPath, "template.json"));
41
+ console.log(`checking: ${join(rootPath, "template.json")}. result ${configExists}`);
42
+ return configExists;
43
+ }
44
+ const action = async function generateTemplate(directory) {
45
+ const rootPath = resolve(directory);
46
+ const templatePath = join(rootPath, "template");
47
+ const exists = await fse.pathExists(templatePath);
48
+ const rootBase = basename(rootPath);
49
+ if (exists) {
50
+ const inquiry = await inquirer.prompt({
51
+ type: "confirm",
52
+ name: "confirm",
53
+ message: `${chalk.yellow(rootBase)} already exists. Do you want to replace it?`
54
+ });
55
+ if (!inquiry.confirm) {
56
+ process.exit(0);
57
+ }
58
+ }
59
+ await fse.ensureDir(templatePath);
60
+ await copyContent(templatePath, rootBase);
61
+ const configExists = await templateConfigExists(rootPath);
62
+ if (!configExists) {
63
+ await writeTemplateJson(rootPath);
64
+ }
65
+ console.log(`${chalk.green("success")}: generated template at ${chalk.yellow(rootPath)}`);
66
+ };
67
+ const command = () => {
68
+ return createCommand("templates:generate <directory>").description("Generate template from Strapi project").action(runAction("templates:generate", action));
69
+ };
70
+ export {
71
+ action,
72
+ command
73
+ };
74
+ //# sourceMappingURL=generate.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"generate.mjs","sources":["../../../../src/cli/commands/templates/generate.ts"],"sourcesContent":["import { createCommand } from 'commander';\nimport { resolve, join, basename } from 'path';\nimport fse from 'fs-extra';\nimport chalk from 'chalk';\nimport inquirer from 'inquirer';\n\nimport type { StrapiCommand } from '../../types';\nimport { runAction } from '../../utils/helpers';\n\n// All directories that a template could need\nconst TEMPLATE_CONTENT = ['src', 'data'];\n\nasync function copyContent(templatePath: string, rootBase: string) {\n for (const item of TEMPLATE_CONTENT) {\n try {\n const pathToCopy = join(process.cwd(), item);\n\n if (!(await fse.pathExists(pathToCopy))) {\n continue;\n }\n\n await fse.copy(pathToCopy, join(templatePath, item));\n const currentProjectBase = basename(process.cwd());\n console.log(\n `${chalk.green(\n 'success'\n )}: copy ${currentProjectBase}/${item} => ${rootBase}/template/${item}`\n );\n } catch (error) {\n if (error instanceof Error) {\n console.error(`${chalk.red('error')}: ${error.message}`);\n }\n }\n }\n}\n\n/**\n *\n * @param {string} rootPath Absolute path to the root directory\n */\nasync function writeTemplateJson(rootPath: string) {\n try {\n await fse.writeJSON(join(rootPath, 'template.json'), {});\n console.log(`${chalk.green('success')}: create JSON config file`);\n } catch (error) {\n if (error instanceof Error) {\n console.error(`${chalk.red('error')}: ${error.message}`);\n }\n }\n}\n\n/**\n *\n * @param {string} rootPath Absolute path to the root directory\n * @returns boolean\n */\nasync function templateConfigExists(rootPath: string) {\n const configExists = await fse.pathExists(join(rootPath, 'template.json'));\n console.log(`checking: ${join(rootPath, 'template.json')}. result ${configExists}`);\n return configExists;\n}\n\nconst action = async function generateTemplate(directory: string) {\n const rootPath = resolve(directory);\n\n // Get path to template directory: <rootPath>/template\n const templatePath = join(rootPath, 'template');\n\n // Check if the template directory exists\n const exists = await fse.pathExists(templatePath);\n const rootBase = basename(rootPath);\n\n if (exists) {\n // Confirm the user wants to replace the existing template\n const inquiry = await inquirer.prompt({\n type: 'confirm',\n name: 'confirm',\n message: `${chalk.yellow(rootBase)} already exists. Do you want to replace it?`,\n });\n\n if (!inquiry.confirm) {\n process.exit(0);\n }\n }\n\n // Create or replace root directory with <roothPath>/template\n await fse.ensureDir(templatePath);\n // Copy content to /template\n await copyContent(templatePath, rootBase);\n // Create config file if it doesn't exist\n const configExists = await templateConfigExists(rootPath);\n if (!configExists) {\n await writeTemplateJson(rootPath);\n }\n\n console.log(`${chalk.green('success')}: generated template at ${chalk.yellow(rootPath)}`);\n};\n\n/**\n *`$ strapi templates:generate <directory>`\n */\nconst command: StrapiCommand = () => {\n return createCommand('templates:generate <directory>')\n .description('Generate template from Strapi project')\n .action(runAction('templates:generate', action));\n};\n\nexport { action, command };\n"],"names":[],"mappings":";;;;;;AAUA,MAAM,mBAAmB,CAAC,OAAO,MAAM;AAEvC,eAAe,YAAY,cAAsB,UAAkB;AACjE,aAAW,QAAQ,kBAAkB;AAC/B,QAAA;AACF,YAAM,aAAa,KAAK,QAAQ,OAAO,IAAI;AAE3C,UAAI,CAAE,MAAM,IAAI,WAAW,UAAU,GAAI;AACvC;AAAA,MACF;AAEA,YAAM,IAAI,KAAK,YAAY,KAAK,cAAc,IAAI,CAAC;AACnD,YAAM,q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