@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.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 = "
|
|
196
|
+
const version = "5.0.2";
|
|
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": "
|
|
241
|
-
axios: "1.
|
|
241
|
+
"@strapi/utils": "workspace:*",
|
|
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": "
|
|
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",
|
|
@@ -253,7 +254,7 @@ const dependencies = {
|
|
|
253
254
|
open: "8.4.0",
|
|
254
255
|
ora: "5.4.1",
|
|
255
256
|
"pkg-up": "3.1.0",
|
|
256
|
-
tar: "6.1
|
|
257
|
+
tar: "6.2.1",
|
|
257
258
|
"xdg-app-paths": "8.3.0",
|
|
258
259
|
yup: "0.32.9"
|
|
259
260
|
};
|
|
@@ -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": "
|
|
266
|
-
tsconfig: "
|
|
266
|
+
"eslint-config-custom": "workspace:*",
|
|
267
|
+
tsconfig: "workspace:*"
|
|
267
268
|
};
|
|
268
269
|
const engines = {
|
|
269
270
|
node: ">=18.0.0 <=20.x.x",
|
|
@@ -375,7 +376,7 @@ async function cloudApiFactory({ logger }, token) {
|
|
|
375
376
|
},
|
|
376
377
|
async listLinkProjects() {
|
|
377
378
|
try {
|
|
378
|
-
const response = await axiosCloudAPI.get("/projects
|
|
379
|
+
const response = await axiosCloudAPI.get("/projects-linkable");
|
|
379
380
|
if (response.status !== 200) {
|
|
380
381
|
throw new Error("Error fetching cloud projects from the server.");
|
|
381
382
|
}
|
|
@@ -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(
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
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 = ({
|
|
1303
|
-
|
|
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 = ({
|
|
1458
|
-
|
|
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 = ({
|
|
1503
|
-
|
|
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 = ({
|
|
1512
|
-
|
|
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
|
}
|