@strapi/cloud-cli 0.0.0-next.c6549bf210addfc92e2ffc84d41d7629cc3c3363 → 0.0.0-next.ce84fada19d58a7dfbdd553035e6558f8befcba4

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.
package/dist/index.js CHANGED
@@ -43,6 +43,7 @@ const cliProgress = require("cli-progress");
43
43
  const pkgUp = require("pkg-up");
44
44
  const yup = require("yup");
45
45
  const EventSource = require("eventsource");
46
+ const commander = require("commander");
46
47
  const _interopDefault = (e) => e && e.__esModule ? e : { default: e };
47
48
  function _interopNamespace(e) {
48
49
  if (e && e.__esModule)
@@ -192,7 +193,7 @@ async function saveLocalConfig(data) {
192
193
  await fse__namespace.default.writeJson(configFilePath, data, { encoding: "utf8", spaces: 2, mode: 384 });
193
194
  }
194
195
  const name = "@strapi/cloud-cli";
195
- const version = "4.25.9";
196
+ const version = "5.0.0";
196
197
  const description = "Commands to interact with the Strapi Cloud";
197
198
  const keywords = [
198
199
  "strapi",
@@ -237,14 +238,14 @@ const scripts = {
237
238
  watch: "pack-up watch"
238
239
  };
239
240
  const dependencies = {
240
- "@strapi/utils": "4.25.9",
241
+ "@strapi/utils": "workspace:*",
241
242
  axios: "1.7.4",
242
243
  chalk: "4.1.2",
243
244
  "cli-progress": "3.12.0",
244
245
  commander: "8.3.0",
245
246
  eventsource: "2.0.2",
246
247
  "fast-safe-stringify": "2.1.1",
247
- "fs-extra": "10.0.0",
248
+ "fs-extra": "11.2.0",
248
249
  inquirer: "8.2.5",
249
250
  jsonwebtoken: "9.0.0",
250
251
  "jwks-rsa": "3.1.0",
@@ -262,8 +263,8 @@ const devDependencies = {
262
263
  "@types/cli-progress": "3.11.5",
263
264
  "@types/eventsource": "1.1.15",
264
265
  "@types/lodash": "^4.14.191",
265
- "eslint-config-custom": "4.25.9",
266
- tsconfig: "4.25.9"
266
+ "eslint-config-custom": "workspace:*",
267
+ tsconfig: "workspace:*"
267
268
  };
268
269
  const engines = {
269
270
  node: ">=18.0.0 <=20.x.x",
@@ -674,21 +675,24 @@ yup__namespace.object({
674
675
  name: yup__namespace.string().required(),
675
676
  exports: yup__namespace.lazy(
676
677
  (value) => yup__namespace.object(
677
- typeof value === "object" ? Object.entries(value).reduce((acc, [key, value2]) => {
678
- if (typeof value2 === "object") {
679
- acc[key] = yup__namespace.object({
680
- types: yup__namespace.string().optional(),
681
- source: yup__namespace.string().required(),
682
- module: yup__namespace.string().optional(),
683
- import: yup__namespace.string().required(),
684
- require: yup__namespace.string().required(),
685
- default: yup__namespace.string().required()
686
- }).noUnknown(true);
687
- } else {
688
- acc[key] = yup__namespace.string().matches(/^\.\/.*\.json$/).required();
689
- }
690
- return acc;
691
- }, {}) : void 0
678
+ typeof value === "object" ? Object.entries(value).reduce(
679
+ (acc, [key, value2]) => {
680
+ if (typeof value2 === "object") {
681
+ acc[key] = yup__namespace.object({
682
+ types: yup__namespace.string().optional(),
683
+ source: yup__namespace.string().required(),
684
+ module: yup__namespace.string().optional(),
685
+ import: yup__namespace.string().required(),
686
+ require: yup__namespace.string().required(),
687
+ default: yup__namespace.string().required()
688
+ }).noUnknown(true);
689
+ } else {
690
+ acc[key] = yup__namespace.string().matches(/^\.\/.*\.json$/).required();
691
+ }
692
+ return acc;
693
+ },
694
+ {}
695
+ ) : void 0
692
696
  ).optional()
693
697
  )
694
698
  });
@@ -1299,8 +1303,8 @@ const runAction = (name2, action2) => (...args) => {
1299
1303
  process.exit(1);
1300
1304
  });
1301
1305
  };
1302
- const command$5 = ({ command: command2, ctx }) => {
1303
- command2.command("cloud:deploy").alias("deploy").description("Deploy a Strapi Cloud project").option("-d, --debug", "Enable debugging mode with verbose logs").option("-s, --silent", "Don't log anything").action(() => runAction("deploy", action$3)(ctx));
1306
+ const command$5 = ({ ctx }) => {
1307
+ return commander.createCommand("cloud:deploy").alias("deploy").description("Deploy a Strapi Cloud project").option("-d, --debug", "Enable debugging mode with verbose logs").option("-s, --silent", "Don't log anything").action(() => runAction("deploy", action$3)(ctx));
1304
1308
  };
1305
1309
  const deployProject = {
1306
1310
  name: "deploy-project",
@@ -1454,8 +1458,8 @@ const link = {
1454
1458
  action: action$2,
1455
1459
  command: command$4
1456
1460
  };
1457
- const command$3 = ({ command: command2, ctx }) => {
1458
- command2.command("cloud:login").alias("login").description("Strapi Cloud Login").addHelpText(
1461
+ const command$3 = ({ ctx }) => {
1462
+ return commander.createCommand("cloud:login").alias("login").description("Strapi Cloud Login").addHelpText(
1459
1463
  "after",
1460
1464
  "\nAfter running this command, you will be prompted to enter your authentication information."
1461
1465
  ).option("-d, --debug", "Enable debugging mode with verbose logs").option("-s, --silent", "Don't log anything").action(() => runAction("login", loginAction)(ctx));
@@ -1499,8 +1503,8 @@ const action$1 = async (ctx) => {
1499
1503
  }
1500
1504
  await trackEvent(ctx, cloudApiService, "didLogout", { loginMethod: "cli" });
1501
1505
  };
1502
- const command$2 = ({ command: command2, ctx }) => {
1503
- command2.command("cloud:logout").alias("logout").description("Strapi Cloud Logout").option("-d, --debug", "Enable debugging mode with verbose logs").option("-s, --silent", "Don't log anything").action(() => runAction("logout", action$1)(ctx));
1506
+ const command$2 = ({ ctx }) => {
1507
+ return commander.createCommand("cloud:logout").alias("logout").description("Strapi Cloud Logout").option("-d, --debug", "Enable debugging mode with verbose logs").option("-s, --silent", "Don't log anything").action(() => runAction("logout", action$1)(ctx));
1504
1508
  };
1505
1509
  const logout = {
1506
1510
  name: "logout",
@@ -1508,8 +1512,8 @@ const logout = {
1508
1512
  action: action$1,
1509
1513
  command: command$2
1510
1514
  };
1511
- const command$1 = ({ command: command2, ctx }) => {
1512
- command2.command("cloud:create-project").description("Create a Strapi Cloud project").option("-d, --debug", "Enable debugging mode with verbose logs").option("-s, --silent", "Don't log anything").action(() => runAction("cloud:create-project", action$4)(ctx));
1515
+ const command$1 = ({ ctx }) => {
1516
+ return commander.createCommand("cloud:create-project").description("Create a Strapi Cloud project").option("-d, --debug", "Enable debugging mode with verbose logs").option("-s, --silent", "Don't log anything").action(() => runAction("cloud:create-project", action$4)(ctx));
1513
1517
  };
1514
1518
  const createProject = {
1515
1519
  name: "create-project",
@@ -1570,7 +1574,10 @@ async function buildStrapiCloudCommands({
1570
1574
  await initCloudCLIConfig();
1571
1575
  for (const cloudCommand of cloudCommands) {
1572
1576
  try {
1573
- await cloudCommand.command({ command: command2, ctx, argv });
1577
+ const subCommand = await cloudCommand.command({ command: command2, ctx, argv });
1578
+ if (subCommand) {
1579
+ command2.addCommand(subCommand);
1580
+ }
1574
1581
  } catch (e) {
1575
1582
  console.error(`Failed to load command ${cloudCommand.name}`, e);
1576
1583
  }