@strapi/cloud-cli 0.0.0-next.aff9d09e4edf4d38b8a0de5abf83d79bedb28313 → 0.0.0-next.b558642be856459a3e6c076f5d76fffbfc5fc5a1
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 +39 -32
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +39 -32
- package/dist/index.mjs.map +1 -1
- package/dist/src/create-project/command.d.ts.map +1 -1
- package/dist/src/deploy-project/command.d.ts.map +1 -1
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/login/command.d.ts.map +1 -1
- package/dist/src/logout/command.d.ts.map +1 -1
- package/dist/src/types.d.ts +1 -1
- package/dist/src/types.d.ts.map +1 -1
- package/dist/src/utils/pkg.d.ts.map +1 -1
- package/dist/src/utils/tests/compress-files.test.d.ts +2 -0
- package/dist/src/utils/tests/compress-files.test.d.ts.map +1 -0
- package/package.json +8 -8
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 = "
|
|
137
|
+
const version = "5.0.2";
|
|
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": "
|
|
182
|
-
axios: "1.
|
|
182
|
+
"@strapi/utils": "workspace:*",
|
|
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": "
|
|
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",
|
|
@@ -194,7 +195,7 @@ const dependencies = {
|
|
|
194
195
|
open: "8.4.0",
|
|
195
196
|
ora: "5.4.1",
|
|
196
197
|
"pkg-up": "3.1.0",
|
|
197
|
-
tar: "6.1
|
|
198
|
+
tar: "6.2.1",
|
|
198
199
|
"xdg-app-paths": "8.3.0",
|
|
199
200
|
yup: "0.32.9"
|
|
200
201
|
};
|
|
@@ -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": "
|
|
207
|
-
tsconfig: "
|
|
207
|
+
"eslint-config-custom": "workspace:*",
|
|
208
|
+
tsconfig: "workspace:*"
|
|
208
209
|
};
|
|
209
210
|
const engines = {
|
|
210
211
|
node: ">=18.0.0 <=20.x.x",
|
|
@@ -316,7 +317,7 @@ async function cloudApiFactory({ logger }, token) {
|
|
|
316
317
|
},
|
|
317
318
|
async listLinkProjects() {
|
|
318
319
|
try {
|
|
319
|
-
const response = await axiosCloudAPI.get("/projects
|
|
320
|
+
const response = await axiosCloudAPI.get("/projects-linkable");
|
|
320
321
|
if (response.status !== 200) {
|
|
321
322
|
throw new Error("Error fetching cloud projects from the server.");
|
|
322
323
|
}
|
|
@@ -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(
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
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 = ({
|
|
1244
|
-
|
|
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 = ({
|
|
1399
|
-
|
|
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 = ({
|
|
1444
|
-
|
|
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 = ({
|
|
1453
|
-
|
|
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
|
}
|