@mittwald/cli 1.9.1 → 1.11.0
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/bin/run.js +4 -1
- package/dist/commands/app/create/node.d.ts +1 -3
- package/dist/commands/app/create/php-worker.d.ts +1 -3
- package/dist/commands/app/create/php.d.ts +1 -3
- package/dist/commands/app/create/python.d.ts +1 -3
- package/dist/commands/app/create/static.d.ts +1 -3
- package/dist/commands/app/dependency/update.js +2 -4
- package/dist/commands/app/download.js +2 -2
- package/dist/commands/app/exec.d.ts +17 -0
- package/dist/commands/app/exec.js +71 -0
- package/dist/commands/app/install/contao.d.ts +1 -3
- package/dist/commands/app/install/joomla.d.ts +1 -3
- package/dist/commands/app/install/matomo.d.ts +1 -3
- package/dist/commands/app/install/nextcloud.d.ts +1 -3
- package/dist/commands/app/install/shopware5.d.ts +1 -3
- package/dist/commands/app/install/shopware6.d.ts +1 -3
- package/dist/commands/app/install/typo3.d.ts +1 -3
- package/dist/commands/app/install/wordpress.d.ts +1 -3
- package/dist/commands/app/ssh.d.ts +1 -0
- package/dist/commands/app/ssh.js +15 -1
- package/dist/commands/app/update.js +4 -8
- package/dist/commands/app/upgrade.js +9 -9
- package/dist/commands/backup/create.js +1 -2
- package/dist/commands/backup/download.js +4 -5
- package/dist/commands/container/exec.d.ts +1 -7
- package/dist/commands/container/exec.js +11 -22
- package/dist/commands/container/run.d.ts +4 -2
- package/dist/commands/container/run.js +7 -6
- package/dist/commands/database/mysql/create.js +1 -2
- package/dist/commands/database/mysql/dump.js +1 -2
- package/dist/commands/database/mysql/import.js +1 -2
- package/dist/commands/ddev/init.js +2 -6
- package/dist/commands/extension/install.js +1 -3
- package/dist/commands/login/reset.js +1 -2
- package/dist/commands/mail/address/create.js +1 -4
- package/dist/commands/mail/deliverybox/create.js +1 -4
- package/dist/commands/project/create.js +4 -6
- package/dist/commands/registry/create.js +1 -2
- package/dist/commands/registry/update.js +1 -2
- package/dist/commands/user/api-token/create.js +1 -1
- package/dist/commands/user/ssh-key/create.js +3 -8
- package/dist/commands/user/ssh-key/import.js +2 -3
- package/dist/hooks/prerun/update-brew-check.js +1 -1
- package/dist/lib/basecommands/DeleteBaseCommand.js +4 -4
- package/dist/lib/ddev/init_assert.js +1 -6
- package/dist/lib/ddev/init_database.js +1 -7
- package/dist/lib/ddev/init_projecttype.js +2 -11
- package/dist/lib/intellij/config.d.ts +5 -0
- package/dist/lib/intellij/config.js +295 -0
- package/dist/lib/intellij/config.test.d.ts +1 -0
- package/dist/lib/intellij/config.test.js +262 -0
- package/dist/lib/intellij/config_xml_types.d.ts +72 -0
- package/dist/lib/intellij/config_xml_types.js +2 -0
- package/dist/lib/resources/app/Installer.d.ts +6 -2
- package/dist/lib/resources/app/Installer.js +13 -6
- package/dist/lib/resources/app/flags.js +9 -12
- package/dist/lib/resources/app/install.d.ts +2 -1
- package/dist/lib/resources/app/install.js +3 -1
- package/dist/lib/resources/app/versions.js +1 -4
- package/dist/lib/resources/app/wait.js +1 -3
- package/dist/lib/resources/mail/commons.js +1 -4
- package/dist/lib/resources/ssh/appinstall.d.ts +3 -1
- package/dist/lib/resources/ssh/appinstall.js +1 -0
- package/dist/lib/resources/ssh/environment.d.ts +7 -0
- package/dist/lib/resources/ssh/environment.js +21 -0
- package/dist/rendering/process/components/ProcessStateIcon.js +1 -1
- package/dist/rendering/process/process.d.ts +16 -16
- package/dist/rendering/process/process_exec.d.ts +1 -2
- package/dist/rendering/process/process_fancy.d.ts +9 -9
- package/dist/rendering/process/process_flags.js +4 -0
- package/dist/rendering/process/process_quiet.d.ts +3 -4
- package/dist/rendering/process/process_simple.d.ts +26 -0
- package/dist/rendering/process/process_simple.js +143 -0
- package/dist/rendering/process/process_simple.test.d.ts +1 -0
- package/dist/rendering/process/process_simple.test.js +149 -0
- package/dist/rendering/react/components/AppInstallation/AppBackendAccessHints.d.ts +15 -0
- package/dist/rendering/react/components/AppInstallation/AppBackendAccessHints.js +13 -0
- package/dist/rendering/react/components/AppInstallation/AppDomainConnectionHints.d.ts +12 -0
- package/dist/rendering/react/components/AppInstallation/AppDomainConnectionHints.js +21 -0
- package/dist/rendering/react/components/AppInstallation/AppManagementCommands.d.ts +12 -0
- package/dist/rendering/react/components/AppInstallation/AppManagementCommands.js +17 -0
- package/dist/rendering/react/components/AppInstallation/AppUsageHints.d.ts +17 -0
- package/dist/rendering/react/components/AppInstallation/AppUsageHints.js +23 -0
- package/dist/rendering/react/components/Container/CommandHint.d.ts +14 -0
- package/dist/rendering/react/components/Container/CommandHint.js +13 -0
- package/dist/rendering/react/components/Container/ContainerManagementCommands.d.ts +22 -0
- package/dist/rendering/react/components/Container/ContainerManagementCommands.js +23 -0
- package/dist/rendering/react/components/Container/ContainerUsageHints.d.ts +12 -0
- package/dist/rendering/react/components/Container/ContainerUsageHints.js +35 -0
- package/dist/rendering/react/components/Container/DomainConnectionHints.d.ts +12 -0
- package/dist/rendering/react/components/Container/DomainConnectionHints.js +21 -0
- package/dist/rendering/react/components/Container/InternalConnectionHints.d.ts +12 -0
- package/dist/rendering/react/components/Container/InternalConnectionHints.js +12 -0
- package/dist/rendering/react/components/Container/NoPortsUsageHints.d.ts +12 -0
- package/dist/rendering/react/components/Container/NoPortsUsageHints.js +12 -0
- package/dist/rendering/react/components/Container/PortConnectionHints.d.ts +13 -0
- package/dist/rendering/react/components/Container/PortConnectionHints.js +11 -0
- package/dist/rendering/react/components/Container/PortForwardingHints.d.ts +12 -0
- package/dist/rendering/react/components/Container/PortForwardingHints.js +18 -0
- package/dist/rendering/react/components/Container/types.d.ts +4 -0
- package/dist/rendering/react/components/Container/types.js +1 -0
- package/dist/rendering/react/components/Error/ErrorBox.d.ts +1 -1
- package/dist/rendering/react/components/Error/ErrorBox.js +3 -4
- package/dist/rendering/react/components/Error/GenericError.js +1 -1
- package/dist/rendering/react/components/ErrorBoundary.d.ts +1 -1
- package/dist/rendering/react/components/Success.d.ts +0 -1
- package/dist/rendering/react/components/Success.js +4 -2
- package/dist/rendering/react/styles/useDefaultBoxStyles.d.ts +11 -0
- package/dist/rendering/react/styles/useDefaultBoxStyles.js +23 -0
- package/package.json +6 -5
|
@@ -8,6 +8,7 @@ import { assertStatus } from "@mittwald/api-client";
|
|
|
8
8
|
import { getImageMeta, getPortMappings, parseEnvironmentVariables, } from "../../lib/resources/container/containerconfig.js";
|
|
9
9
|
import { Success } from "../../rendering/react/components/Success.js";
|
|
10
10
|
import { Value } from "../../rendering/react/components/Value.js";
|
|
11
|
+
import ContainerUsageHints from "../../rendering/react/components/Container/ContainerUsageHints.js";
|
|
11
12
|
export class Run extends ExecRenderBaseCommand {
|
|
12
13
|
static summary = "Creates and starts a new container.";
|
|
13
14
|
static strict = false;
|
|
@@ -109,12 +110,11 @@ export class Run extends ExecRenderBaseCommand {
|
|
|
109
110
|
const serviceRequest = await p.runStep("preparing service request", this.buildServiceRequest(image, imageMeta, serviceName));
|
|
110
111
|
const stack = await p.runStep("creating container", this.addServiceToStack(stackId, serviceName, serviceRequest));
|
|
111
112
|
const service = stack.services?.find(matchServiceByName(serviceName));
|
|
112
|
-
|
|
113
|
-
if (!serviceId) {
|
|
113
|
+
if (!service) {
|
|
114
114
|
throw new Error("Service ID not found in the created stack.");
|
|
115
115
|
}
|
|
116
|
-
await p.complete(_jsxs(Success, { children: ["Container ", _jsx(Value, { children:
|
|
117
|
-
return {
|
|
116
|
+
await p.complete(_jsxs(Success, { children: ["Container ", _jsx(Value, { children: service.serviceName }), " was successfully created and started."] }));
|
|
117
|
+
return { service };
|
|
118
118
|
}
|
|
119
119
|
async addServiceToStack(stackId, serviceName, serviceRequest) {
|
|
120
120
|
const updateData = {
|
|
@@ -220,10 +220,11 @@ export class Run extends ExecRenderBaseCommand {
|
|
|
220
220
|
}
|
|
221
221
|
return dockerNames.getRandomName();
|
|
222
222
|
}
|
|
223
|
-
render({
|
|
223
|
+
render({ service }) {
|
|
224
224
|
if (this.flags.quiet) {
|
|
225
|
-
return
|
|
225
|
+
return service.id;
|
|
226
226
|
}
|
|
227
|
+
return _jsx(ContainerUsageHints, { service: service });
|
|
227
228
|
}
|
|
228
229
|
}
|
|
229
230
|
function matchServiceByName(name) {
|
|
@@ -3,7 +3,6 @@ import { ExecRenderBaseCommand } from "../../../lib/basecommands/ExecRenderBaseC
|
|
|
3
3
|
import { projectFlags } from "../../../lib/resources/project/flags.js";
|
|
4
4
|
import { makeProcessRenderer, processFlags, } from "../../../rendering/process/process_flags.js";
|
|
5
5
|
import { Flags } from "@oclif/core";
|
|
6
|
-
import { Text } from "ink";
|
|
7
6
|
import { assertStatus } from "@mittwald/api-client-commons";
|
|
8
7
|
import { Success } from "../../../rendering/react/components/Success.js";
|
|
9
8
|
import { Value } from "../../../rendering/react/components/Value.js";
|
|
@@ -95,7 +94,7 @@ export class Create extends ExecRenderBaseCommand {
|
|
|
95
94
|
if (this.flags["user-password"]) {
|
|
96
95
|
return this.flags["user-password"];
|
|
97
96
|
}
|
|
98
|
-
return await p.addInput(
|
|
97
|
+
return await p.addInput("enter password for default user", true);
|
|
99
98
|
}
|
|
100
99
|
render({ databaseId }) {
|
|
101
100
|
if (this.flags.quiet) {
|
|
@@ -2,7 +2,6 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
2
2
|
import { ExecRenderBaseCommand } from "../../../lib/basecommands/ExecRenderBaseCommand.js";
|
|
3
3
|
import { Flags } from "@oclif/core";
|
|
4
4
|
import { makeProcessRenderer, processFlags, } from "../../../rendering/process/process_flags.js";
|
|
5
|
-
import { Text } from "ink";
|
|
6
5
|
import { Value } from "../../../rendering/react/components/Value.js";
|
|
7
6
|
import * as fs from "fs";
|
|
8
7
|
import { Success } from "../../../rendering/react/components/Success.js";
|
|
@@ -48,7 +47,7 @@ export class Dump extends ExecRenderBaseCommand {
|
|
|
48
47
|
shell: `set -e -o pipefail > /dev/null ; mysqldump ${escapedArgs} | gzip`,
|
|
49
48
|
};
|
|
50
49
|
}
|
|
51
|
-
await p.runStep(
|
|
50
|
+
await p.runStep(`starting mysqldump via SSH on project ${project.shortId}`, () => executeViaSSH(this.apiClient, this.flags, { projectId: connectionDetails.project.id }, cmd, { input: null, output: this.getOutputStream() }));
|
|
52
51
|
return connectionDetails.database;
|
|
53
52
|
});
|
|
54
53
|
await p.complete(_jsx(DumpSuccess, { database: databaseName, output: this.flags.output }));
|
|
@@ -2,7 +2,6 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
2
2
|
import { ExecRenderBaseCommand } from "../../../lib/basecommands/ExecRenderBaseCommand.js";
|
|
3
3
|
import { Flags } from "@oclif/core";
|
|
4
4
|
import { makeProcessRenderer, processFlags, } from "../../../rendering/process/process_flags.js";
|
|
5
|
-
import { Text } from "ink";
|
|
6
5
|
import { Value } from "../../../rendering/react/components/Value.js";
|
|
7
6
|
import * as fs from "fs";
|
|
8
7
|
import { Success } from "../../../rendering/react/components/Success.js";
|
|
@@ -48,7 +47,7 @@ export class Import extends ExecRenderBaseCommand {
|
|
|
48
47
|
shell: `set -e -o pipefail > /dev/null ; gunzip | mysql ${escapedArgs}`,
|
|
49
48
|
};
|
|
50
49
|
}
|
|
51
|
-
await p.runStep(
|
|
50
|
+
await p.runStep(`starting mysql via SSH on project ${project.shortId}`, () => executeViaSSH(this.apiClient, this.flags, { projectId: connectionDetails.project.id }, cmd, { input: this.getInputStream(), output: null }));
|
|
52
51
|
return connectionDetails.database;
|
|
53
52
|
});
|
|
54
53
|
await p.complete(_jsx(ImportSuccess, { database: databaseName, input: this.flags.input }));
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { jsx as _jsx
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import { ExecRenderBaseCommand } from "../../lib/basecommands/ExecRenderBaseCommand.js";
|
|
3
3
|
import { appInstallationArgs } from "../../lib/resources/app/flags.js";
|
|
4
4
|
import { makeProcessRenderer, processFlags, } from "../../rendering/process/process_flags.js";
|
|
@@ -11,7 +11,6 @@ import { DDEVInitSuccess } from "../../rendering/react/components/DDEV/DDEVInitS
|
|
|
11
11
|
import { ddevConfigToFlags } from "../../lib/ddev/config.js";
|
|
12
12
|
import { renderDDEVConfig } from "../../lib/ddev/config_render.js";
|
|
13
13
|
import { loadDDEVConfig } from "../../lib/ddev/config_loader.js";
|
|
14
|
-
import { Value } from "../../rendering/react/components/Value.js";
|
|
15
14
|
import { ddevFlags } from "../../lib/ddev/flags.js";
|
|
16
15
|
import { compareSemVer } from "semver-parser";
|
|
17
16
|
import { assertStatus } from "@mittwald/api-client";
|
|
@@ -114,7 +113,7 @@ export class Init extends ExecRenderBaseCommand {
|
|
|
114
113
|
}
|
|
115
114
|
const existing = await loadDDEVConfig();
|
|
116
115
|
if (existing?.name) {
|
|
117
|
-
r.addInfo(
|
|
116
|
+
r.addInfo(`using existing project name: ${existing.name}`);
|
|
118
117
|
return existing.name;
|
|
119
118
|
}
|
|
120
119
|
return await r.addInput("Enter the project name", false);
|
|
@@ -174,6 +173,3 @@ async function writeContentsToFile(filename, data) {
|
|
|
174
173
|
await mkdir(dirname, { recursive: true });
|
|
175
174
|
await writeFile(filename, data);
|
|
176
175
|
}
|
|
177
|
-
function InfoUsingExistingName({ name }) {
|
|
178
|
-
return (_jsxs(_Fragment, { children: ["using existing project name: ", _jsx(Value, { children: name })] }));
|
|
179
|
-
}
|
|
@@ -1,9 +1,7 @@
|
|
|
1
|
-
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
1
|
import { ExecRenderBaseCommand } from "../../lib/basecommands/ExecRenderBaseCommand.js";
|
|
3
2
|
import { makeProcessRenderer, processFlags, } from "../../rendering/process/process_flags.js";
|
|
4
3
|
import { Args, Flags } from "@oclif/core";
|
|
5
4
|
import { assertStatus } from "@mittwald/api-client";
|
|
6
|
-
import { Text } from "ink";
|
|
7
5
|
import Context, { contextIDNormalizers } from "../../lib/context/Context.js";
|
|
8
6
|
export default class Install extends ExecRenderBaseCommand {
|
|
9
7
|
static description = "Install an extension in a project or organization";
|
|
@@ -49,7 +47,7 @@ export default class Install extends ExecRenderBaseCommand {
|
|
|
49
47
|
projectId = await normalizer(this.apiClient, projectId, ctx);
|
|
50
48
|
}
|
|
51
49
|
if (!consent) {
|
|
52
|
-
p.addInfo(
|
|
50
|
+
p.addInfo(`This extension requires access to the following scopes: ${ext.scopes.join(", ")}. Please confirm your consent, or run the command with the --consent flag.`);
|
|
53
51
|
const consentedInteractively = await p.addConfirmation("Consent to requested scopes?");
|
|
54
52
|
if (!consentedInteractively) {
|
|
55
53
|
throw new Error("Consent was not given; skipping extension installation");
|
|
@@ -4,7 +4,6 @@ import { ExecRenderBaseCommand } from "../../lib/basecommands/ExecRenderBaseComm
|
|
|
4
4
|
import { Box, Text } from "ink";
|
|
5
5
|
import { Note } from "../../rendering/react/components/Note.js";
|
|
6
6
|
import { FancyProcessRenderer } from "../../rendering/process/process_fancy.js";
|
|
7
|
-
import { Filename } from "../../rendering/react/components/Filename.js";
|
|
8
7
|
import { getTokenFilename } from "../../lib/auth/token.js";
|
|
9
8
|
import { isNotFound } from "../../lib/util/fs/isNotFound.js";
|
|
10
9
|
export default class Reset extends ExecRenderBaseCommand {
|
|
@@ -15,7 +14,7 @@ export default class Reset extends ExecRenderBaseCommand {
|
|
|
15
14
|
const tokenFilename = getTokenFilename(this.config);
|
|
16
15
|
process.start();
|
|
17
16
|
if (await this.tokenFileExists(tokenFilename)) {
|
|
18
|
-
const step = process.addStep(
|
|
17
|
+
const step = process.addStep(`Deleting token file ${tokenFilename}`);
|
|
19
18
|
await fs.rm(tokenFilename, { force: true });
|
|
20
19
|
step.complete();
|
|
21
20
|
await process.complete(_jsxs(Box, { flexDirection: "column", children: [_jsx(Text, { children: "Authentication state successfully reset" }), _jsx(Note, { children: "Please keep in mind that this does not invalidate the token on the server. Invalidate your API token using the mStudio web interface, or using the 'mw user api-token revoke' command." })] }));
|
|
@@ -91,10 +91,7 @@ export default class Create extends ExecRenderBaseCommand {
|
|
|
91
91
|
if (this.flags["random-password"]) {
|
|
92
92
|
return [await generateRandomPassword(process), true];
|
|
93
93
|
}
|
|
94
|
-
return [
|
|
95
|
-
await process.addInput(_jsx(Text, { children: "enter mailbox password" }), true),
|
|
96
|
-
false,
|
|
97
|
-
];
|
|
94
|
+
return [await process.addInput("enter mailbox password", true), false];
|
|
98
95
|
}
|
|
99
96
|
async createForwardAddress(projectId, process, flags) {
|
|
100
97
|
const response = await process.runStep("creating mail address", async () => {
|
|
@@ -50,10 +50,7 @@ export default class Create extends ExecRenderBaseCommand {
|
|
|
50
50
|
if (this.flags["random-password"]) {
|
|
51
51
|
return [await generateRandomPassword(process), true];
|
|
52
52
|
}
|
|
53
|
-
return [
|
|
54
|
-
await process.addInput(_jsx(Text, { children: "enter delivery box password" }), true),
|
|
55
|
-
false,
|
|
56
|
-
];
|
|
53
|
+
return [await process.addInput("enter delivery box password", true), false];
|
|
57
54
|
}
|
|
58
55
|
async createMailDeliveryBox(projectId, process, flags) {
|
|
59
56
|
const [password, passwordGenerated] = await this.getPassword(process);
|
|
@@ -1,11 +1,9 @@
|
|
|
1
|
-
import { jsx as _jsx
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import { Flags } from "@oclif/core";
|
|
3
3
|
import { assertStatus } from "@mittwald/api-client-commons";
|
|
4
4
|
import { serverFlags } from "../../lib/resources/server/flags.js";
|
|
5
5
|
import { ExecRenderBaseCommand } from "../../lib/basecommands/ExecRenderBaseCommand.js";
|
|
6
|
-
import { Text } from "ink";
|
|
7
6
|
import { Success } from "../../rendering/react/components/Success.js";
|
|
8
|
-
import { Value } from "../../rendering/react/components/Value.js";
|
|
9
7
|
import { makeProcessRenderer, processFlags, } from "../../rendering/process/process_flags.js";
|
|
10
8
|
import { waitFlags, waitUntil } from "../../lib/wait.js";
|
|
11
9
|
import Context from "../../lib/context/Context.js";
|
|
@@ -29,16 +27,16 @@ export default class Create extends ExecRenderBaseCommand {
|
|
|
29
27
|
const { description } = flags;
|
|
30
28
|
const process = makeProcessRenderer(flags, "Creating project");
|
|
31
29
|
const serverId = await this.withServerId(Create);
|
|
32
|
-
const stepCreating = process.addStep(
|
|
30
|
+
const stepCreating = process.addStep("creating a new project");
|
|
33
31
|
const result = await this.apiClient.project.createProject({
|
|
34
32
|
serverId,
|
|
35
33
|
data: { description },
|
|
36
34
|
});
|
|
37
35
|
assertStatus(result, 201);
|
|
38
36
|
stepCreating.complete();
|
|
39
|
-
process.addInfo(
|
|
37
|
+
process.addInfo(`project ID: ${result.data.id}`);
|
|
40
38
|
if (flags.wait) {
|
|
41
|
-
const stepWaiting = process.addStep(
|
|
39
|
+
const stepWaiting = process.addStep("waiting for project to be ready");
|
|
42
40
|
await waitUntil(async () => {
|
|
43
41
|
const projectResponse = await this.apiClient.project.getProject({
|
|
44
42
|
projectId: result.data.id,
|
|
@@ -6,7 +6,6 @@ import { Success } from "../../rendering/react/components/Success.js";
|
|
|
6
6
|
import { Value } from "../../rendering/react/components/Value.js";
|
|
7
7
|
import { projectFlags } from "../../lib/resources/project/flags.js";
|
|
8
8
|
import { Flags } from "@oclif/core";
|
|
9
|
-
import { Text } from "ink";
|
|
10
9
|
export class Create extends ExecRenderBaseCommand {
|
|
11
10
|
static summary = "Create a new container registry";
|
|
12
11
|
static flags = {
|
|
@@ -72,6 +71,6 @@ export class Create extends ExecRenderBaseCommand {
|
|
|
72
71
|
if (this.flags.password) {
|
|
73
72
|
return this.flags.password;
|
|
74
73
|
}
|
|
75
|
-
return await process.addInput(
|
|
74
|
+
return await process.addInput("enter registry password", true);
|
|
76
75
|
}
|
|
77
76
|
}
|
|
@@ -4,7 +4,6 @@ import { Args, Flags } from "@oclif/core";
|
|
|
4
4
|
import { makeProcessRenderer, processFlags, } from "../../rendering/process/process_flags.js";
|
|
5
5
|
import { Success } from "../../rendering/react/components/Success.js";
|
|
6
6
|
import assertSuccess from "../../lib/apiutil/assert_success.js";
|
|
7
|
-
import { Text } from "ink";
|
|
8
7
|
export default class Update extends ExecRenderBaseCommand {
|
|
9
8
|
static description = "Update an existing container registry";
|
|
10
9
|
static args = {
|
|
@@ -68,6 +67,6 @@ export default class Update extends ExecRenderBaseCommand {
|
|
|
68
67
|
if (this.flags.password) {
|
|
69
68
|
return this.flags.password;
|
|
70
69
|
}
|
|
71
|
-
return await process.addInput(
|
|
70
|
+
return await process.addInput("enter registry password", true);
|
|
72
71
|
}
|
|
73
72
|
}
|
|
@@ -39,7 +39,7 @@ export default class Create extends ExecRenderBaseCommand {
|
|
|
39
39
|
});
|
|
40
40
|
step.complete();
|
|
41
41
|
assertStatus(response, 201);
|
|
42
|
-
process.complete(_jsx(Success, {
|
|
42
|
+
process.complete(_jsx(Success, { children: _jsxs(Text, { children: ["API token successfully created. Have fun. \uD83E\uDD73", _jsx(Newline, { count: 2 }), "This is your API token; make sure to store it somewhere safe:", _jsx(Newline, { count: 1 }), _jsx(Value, { children: response.data.token })] }) }));
|
|
43
43
|
return { token: response.data.token };
|
|
44
44
|
}
|
|
45
45
|
catch (e) {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { jsx as _jsx
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import { Flags } from "@oclif/core";
|
|
3
3
|
import { assertStatus } from "@mittwald/api-client-commons";
|
|
4
4
|
import * as path from "path";
|
|
@@ -7,8 +7,6 @@ import * as fs from "fs/promises";
|
|
|
7
7
|
import { ExecRenderBaseCommand } from "../../../lib/basecommands/ExecRenderBaseCommand.js";
|
|
8
8
|
import { makeProcessRenderer, processFlags, } from "../../../rendering/process/process_flags.js";
|
|
9
9
|
import { Success } from "../../../rendering/react/components/Success.js";
|
|
10
|
-
import { Filename } from "../../../rendering/react/components/Filename.js";
|
|
11
|
-
import { Text } from "ink";
|
|
12
10
|
import { spawnInProcess } from "../../../rendering/process/process_exec.js";
|
|
13
11
|
import { expireFlags } from "../../../lib/flags/expireFlags.js";
|
|
14
12
|
export default class Create extends ExecRenderBaseCommand {
|
|
@@ -39,7 +37,7 @@ export default class Create extends ExecRenderBaseCommand {
|
|
|
39
37
|
}
|
|
40
38
|
await spawnInProcess(r, "generating SSH key using ssh-keygen", cmd, args);
|
|
41
39
|
const publicKey = await fs.readFile(outputFile + ".pub", "utf-8");
|
|
42
|
-
r.addInfo(
|
|
40
|
+
r.addInfo(`ssh key saved to ${outputFile}.`);
|
|
43
41
|
await r.runStep("importing SSH key", async () => {
|
|
44
42
|
const response = await this.apiClient.user.createSshKey({
|
|
45
43
|
data: {
|
|
@@ -58,12 +56,9 @@ export default class Create extends ExecRenderBaseCommand {
|
|
|
58
56
|
if (this.flags["no-passphrase"]) {
|
|
59
57
|
return "";
|
|
60
58
|
}
|
|
61
|
-
return await r.addInput(
|
|
59
|
+
return await r.addInput("enter passphrase for SSH key", true);
|
|
62
60
|
}
|
|
63
61
|
}
|
|
64
62
|
function SSHKeySuccess() {
|
|
65
63
|
return (_jsx(Success, { children: "Your SSH key was successfully created and imported to your user profile." }));
|
|
66
64
|
}
|
|
67
|
-
function InfoSSHKeySaved({ filename }) {
|
|
68
|
-
return (_jsxs(Text, { children: ["ssh key saved to ", _jsx(Filename, { filename: filename }), "."] }));
|
|
69
|
-
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { jsx as _jsx
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import { Flags } from "@oclif/core";
|
|
3
3
|
import { assertStatus } from "@mittwald/api-client-commons";
|
|
4
4
|
import * as path from "path";
|
|
@@ -7,7 +7,6 @@ import * as fs from "fs/promises";
|
|
|
7
7
|
import { ExecRenderBaseCommand } from "../../../lib/basecommands/ExecRenderBaseCommand.js";
|
|
8
8
|
import { makeProcessRenderer, processFlags, } from "../../../rendering/process/process_flags.js";
|
|
9
9
|
import { Success } from "../../../rendering/react/components/Success.js";
|
|
10
|
-
import { Filename } from "../../../rendering/react/components/Filename.js";
|
|
11
10
|
import { expireFlags } from "../../../lib/flags/expireFlags.js";
|
|
12
11
|
export default class Import extends ExecRenderBaseCommand {
|
|
13
12
|
static description = "Import an existing (local) SSH key";
|
|
@@ -32,7 +31,7 @@ export default class Import extends ExecRenderBaseCommand {
|
|
|
32
31
|
});
|
|
33
32
|
const keyAlreadyExists = (keys.sshKeys ?? []).some(({ key }) => publicKeyParts.includes(key));
|
|
34
33
|
if (keyAlreadyExists) {
|
|
35
|
-
r.addInfo(
|
|
34
|
+
r.addInfo(`the SSH key ${inputFile} is already imported.`);
|
|
36
35
|
await r.complete(_jsx(SSHKeySuccess, {}));
|
|
37
36
|
return;
|
|
38
37
|
}
|
|
@@ -3,7 +3,7 @@ const hook = async function (opts) {
|
|
|
3
3
|
const isInstalledWithBrew = () => {
|
|
4
4
|
try {
|
|
5
5
|
const cellar = execSync("brew --cellar", { encoding: "utf8" });
|
|
6
|
-
return opts.config.root.startsWith(cellar);
|
|
6
|
+
return opts.config.root.startsWith(cellar.trim());
|
|
7
7
|
}
|
|
8
8
|
catch {
|
|
9
9
|
return false;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { Flags, ux } from "@oclif/core";
|
|
3
3
|
import { ExecRenderBaseCommand } from "./ExecRenderBaseCommand.js";
|
|
4
4
|
import { makeProcessRenderer, processFlags, } from "../../rendering/process/process_flags.js";
|
|
@@ -18,15 +18,15 @@ export class DeleteBaseCommand extends ExecRenderBaseCommand {
|
|
|
18
18
|
const resourceName = this.ctor.resourceName;
|
|
19
19
|
const process = makeProcessRenderer(this.flags, `Deleting ${resourceName}`);
|
|
20
20
|
if (!this.flags.force) {
|
|
21
|
-
const confirmed = await process.addConfirmation(
|
|
21
|
+
const confirmed = await process.addConfirmation(`confirm deletion of ${resourceName}`);
|
|
22
22
|
if (!confirmed) {
|
|
23
|
-
process.addInfo(
|
|
23
|
+
process.addInfo(`deletion of ${resourceName} was cancelled`);
|
|
24
24
|
process.complete(_jsx(_Fragment, {}));
|
|
25
25
|
ux.exit(1);
|
|
26
26
|
return;
|
|
27
27
|
}
|
|
28
28
|
}
|
|
29
|
-
const deletingStep = process.addStep(
|
|
29
|
+
const deletingStep = process.addStep(`deleting ${resourceName}`);
|
|
30
30
|
try {
|
|
31
31
|
await this.deleteResource();
|
|
32
32
|
deletingStep.complete();
|
|
@@ -1,7 +1,5 @@
|
|
|
1
|
-
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
1
|
import { promisify } from "util";
|
|
3
2
|
import { exec } from "child_process";
|
|
4
|
-
import { Value } from "../../rendering/react/components/Value.js";
|
|
5
3
|
import { hasBinaryInPath } from "../util/fs/hasBinaryInPath.js";
|
|
6
4
|
const execAsync = promisify(exec);
|
|
7
5
|
export async function assertDDEVIsInstalled(r) {
|
|
@@ -14,9 +12,6 @@ export async function assertDDEVIsInstalled(r) {
|
|
|
14
12
|
export async function determineDDEVVersion(r) {
|
|
15
13
|
const { stdout } = await execAsync("ddev --version");
|
|
16
14
|
const version = stdout.trim().replace(/^ddev version +/, "");
|
|
17
|
-
r.addInfo(
|
|
15
|
+
r.addInfo(`detected DDEV version: ${version}`);
|
|
18
16
|
return version;
|
|
19
17
|
}
|
|
20
|
-
function InfoDDEVVersion({ version }) {
|
|
21
|
-
return (_jsxs(_Fragment, { children: ["detected DDEV version: ", _jsx(Value, { children: version })] }));
|
|
22
|
-
}
|
|
@@ -1,7 +1,4 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
1
|
import { assertStatus, } from "@mittwald/api-client";
|
|
3
|
-
import { Value } from "../../rendering/react/components/Value.js";
|
|
4
|
-
import { Text } from "ink";
|
|
5
2
|
/**
|
|
6
3
|
* Determines the database ID to use for the DDEV project.
|
|
7
4
|
*
|
|
@@ -29,7 +26,7 @@ export async function determineDDEVDatabaseId(r, apiClient, flags, appInstallati
|
|
|
29
26
|
mysqlDatabaseId: databaseId,
|
|
30
27
|
});
|
|
31
28
|
assertStatus(mysqlDatabaseResponse, 200);
|
|
32
|
-
r.addInfo(
|
|
29
|
+
r.addInfo(`using database: ${mysqlDatabaseResponse.data.name}`);
|
|
33
30
|
return mysqlDatabaseResponse.data.name;
|
|
34
31
|
}
|
|
35
32
|
return await promptDatabaseFromUser(r, apiClient, appInstallation);
|
|
@@ -54,6 +51,3 @@ async function promptDatabaseFromUser(r, apiClient, appInstallation) {
|
|
|
54
51
|
},
|
|
55
52
|
]);
|
|
56
53
|
}
|
|
57
|
-
function InfoDatabase({ name }) {
|
|
58
|
-
return (_jsxs(Text, { children: ["using database: ", _jsx(Value, { children: name })] }));
|
|
59
|
-
}
|
|
@@ -1,9 +1,6 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
1
|
import { typo3Installer } from "../../commands/app/install/typo3.js";
|
|
3
2
|
import { wordpressInstaller } from "../../commands/app/install/wordpress.js";
|
|
4
3
|
import { shopware6Installer } from "../../commands/app/install/shopware6.js";
|
|
5
|
-
import { Value } from "../../rendering/react/components/Value.js";
|
|
6
|
-
import { Text } from "ink";
|
|
7
4
|
/**
|
|
8
5
|
* A list of all known DDEV project types. Shamelessly stolen from
|
|
9
6
|
* https://ddev.readthedocs.io/en/latest/users/configuration/config/#type
|
|
@@ -38,12 +35,12 @@ export const knownDDEVProjectTypes = [
|
|
|
38
35
|
*/
|
|
39
36
|
export async function determineProjectType(r, client, inst, typeOverride) {
|
|
40
37
|
if (typeOverride !== "auto") {
|
|
41
|
-
r.addInfo(
|
|
38
|
+
r.addInfo(`using DDEV project type: ${typeOverride} (explicitly specified)`);
|
|
42
39
|
return typeOverride;
|
|
43
40
|
}
|
|
44
41
|
const determinedProjectType = await determineProjectTypeFromAppInstallation(client, inst);
|
|
45
42
|
if (determinedProjectType !== null) {
|
|
46
|
-
r.addInfo(
|
|
43
|
+
r.addInfo(`using DDEV project type: ${determinedProjectType} (derived from app installation)`);
|
|
47
44
|
return determinedProjectType;
|
|
48
45
|
}
|
|
49
46
|
return await promptProjectTypeFromUser(r);
|
|
@@ -76,9 +73,3 @@ export async function determineProjectTypeFromAppInstallation(client, inst) {
|
|
|
76
73
|
return null;
|
|
77
74
|
}
|
|
78
75
|
}
|
|
79
|
-
function ProjectTypeInfoOverride({ type }) {
|
|
80
|
-
return (_jsxs(Text, { children: ["using DDEV project type: ", _jsx(Value, { children: type }), " (explicitly specified)"] }));
|
|
81
|
-
}
|
|
82
|
-
function ProjectTypeInfoAuto({ type }) {
|
|
83
|
-
return (_jsxs(Text, { children: ["using DDEV project type: ", _jsx(Value, { children: type }), " (derived from app installation)"] }));
|
|
84
|
-
}
|