@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.mjs CHANGED
@@ -21,6 +21,7 @@ import * as cliProgress from "cli-progress";
21
21
  import pkgUp from "pkg-up";
22
22
  import * as yup from "yup";
23
23
  import EventSource from "eventsource";
24
+ import { createCommand } from "commander";
24
25
  const apiConfig = {
25
26
  apiBaseUrl: env("STRAPI_CLI_CLOUD_API", "https://cloud-cli-api.strapi.io"),
26
27
  dashboardBaseUrl: env("STRAPI_CLI_CLOUD_DASHBOARD", "https://cloud.strapi.io")
@@ -133,7 +134,7 @@ async function saveLocalConfig(data) {
133
134
  await fse__default.writeJson(configFilePath, data, { encoding: "utf8", spaces: 2, mode: 384 });
134
135
  }
135
136
  const name = "@strapi/cloud-cli";
136
- const version = "4.25.9";
137
+ const version = "5.0.0";
137
138
  const description = "Commands to interact with the Strapi Cloud";
138
139
  const keywords = [
139
140
  "strapi",
@@ -178,14 +179,14 @@ const scripts = {
178
179
  watch: "pack-up watch"
179
180
  };
180
181
  const dependencies = {
181
- "@strapi/utils": "4.25.9",
182
+ "@strapi/utils": "workspace:*",
182
183
  axios: "1.7.4",
183
184
  chalk: "4.1.2",
184
185
  "cli-progress": "3.12.0",
185
186
  commander: "8.3.0",
186
187
  eventsource: "2.0.2",
187
188
  "fast-safe-stringify": "2.1.1",
188
- "fs-extra": "10.0.0",
189
+ "fs-extra": "11.2.0",
189
190
  inquirer: "8.2.5",
190
191
  jsonwebtoken: "9.0.0",
191
192
  "jwks-rsa": "3.1.0",
@@ -203,8 +204,8 @@ const devDependencies = {
203
204
  "@types/cli-progress": "3.11.5",
204
205
  "@types/eventsource": "1.1.15",
205
206
  "@types/lodash": "^4.14.191",
206
- "eslint-config-custom": "4.25.9",
207
- tsconfig: "4.25.9"
207
+ "eslint-config-custom": "workspace:*",
208
+ tsconfig: "workspace:*"
208
209
  };
209
210
  const engines = {
210
211
  node: ">=18.0.0 <=20.x.x",
@@ -615,21 +616,24 @@ yup.object({
615
616
  name: yup.string().required(),
616
617
  exports: yup.lazy(
617
618
  (value) => yup.object(
618
- typeof value === "object" ? Object.entries(value).reduce((acc, [key, value2]) => {
619
- if (typeof value2 === "object") {
620
- acc[key] = yup.object({
621
- types: yup.string().optional(),
622
- source: yup.string().required(),
623
- module: yup.string().optional(),
624
- import: yup.string().required(),
625
- require: yup.string().required(),
626
- default: yup.string().required()
627
- }).noUnknown(true);
628
- } else {
629
- acc[key] = yup.string().matches(/^\.\/.*\.json$/).required();
630
- }
631
- return acc;
632
- }, {}) : void 0
619
+ typeof value === "object" ? Object.entries(value).reduce(
620
+ (acc, [key, value2]) => {
621
+ if (typeof value2 === "object") {
622
+ acc[key] = yup.object({
623
+ types: yup.string().optional(),
624
+ source: yup.string().required(),
625
+ module: yup.string().optional(),
626
+ import: yup.string().required(),
627
+ require: yup.string().required(),
628
+ default: yup.string().required()
629
+ }).noUnknown(true);
630
+ } else {
631
+ acc[key] = yup.string().matches(/^\.\/.*\.json$/).required();
632
+ }
633
+ return acc;
634
+ },
635
+ {}
636
+ ) : void 0
633
637
  ).optional()
634
638
  )
635
639
  });
@@ -1240,8 +1244,8 @@ const runAction = (name2, action2) => (...args) => {
1240
1244
  process.exit(1);
1241
1245
  });
1242
1246
  };
1243
- const command$5 = ({ command: command2, ctx }) => {
1244
- 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));
1247
+ const command$5 = ({ ctx }) => {
1248
+ return 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));
1245
1249
  };
1246
1250
  const deployProject = {
1247
1251
  name: "deploy-project",
@@ -1395,8 +1399,8 @@ const link = {
1395
1399
  action: action$2,
1396
1400
  command: command$4
1397
1401
  };
1398
- const command$3 = ({ command: command2, ctx }) => {
1399
- command2.command("cloud:login").alias("login").description("Strapi Cloud Login").addHelpText(
1402
+ const command$3 = ({ ctx }) => {
1403
+ return createCommand("cloud:login").alias("login").description("Strapi Cloud Login").addHelpText(
1400
1404
  "after",
1401
1405
  "\nAfter running this command, you will be prompted to enter your authentication information."
1402
1406
  ).option("-d, --debug", "Enable debugging mode with verbose logs").option("-s, --silent", "Don't log anything").action(() => runAction("login", loginAction)(ctx));
@@ -1440,8 +1444,8 @@ const action$1 = async (ctx) => {
1440
1444
  }
1441
1445
  await trackEvent(ctx, cloudApiService, "didLogout", { loginMethod: "cli" });
1442
1446
  };
1443
- const command$2 = ({ command: command2, ctx }) => {
1444
- 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));
1447
+ const command$2 = ({ ctx }) => {
1448
+ return 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));
1445
1449
  };
1446
1450
  const logout = {
1447
1451
  name: "logout",
@@ -1449,8 +1453,8 @@ const logout = {
1449
1453
  action: action$1,
1450
1454
  command: command$2
1451
1455
  };
1452
- const command$1 = ({ command: command2, ctx }) => {
1453
- 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));
1456
+ const command$1 = ({ ctx }) => {
1457
+ return 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));
1454
1458
  };
1455
1459
  const createProject = {
1456
1460
  name: "create-project",
@@ -1511,7 +1515,10 @@ async function buildStrapiCloudCommands({
1511
1515
  await initCloudCLIConfig();
1512
1516
  for (const cloudCommand of cloudCommands) {
1513
1517
  try {
1514
- await cloudCommand.command({ command: command2, ctx, argv });
1518
+ const subCommand = await cloudCommand.command({ command: command2, ctx, argv });
1519
+ if (subCommand) {
1520
+ command2.addCommand(subCommand);
1521
+ }
1515
1522
  } catch (e) {
1516
1523
  console.error(`Failed to load command ${cloudCommand.name}`, e);
1517
1524
  }