dockup-cli 1.0.2 → 1.1.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.
@@ -1,135 +1,151 @@
1
1
  "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
2
+ var __create = Object.create;
3
+ var __defProp = Object.defineProperty;
4
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
+ var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __getProtoOf = Object.getPrototypeOf;
7
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
8
+ var __export = (target, all) => {
9
+ for (var name in all)
10
+ __defProp(target, name, { get: all[name], enumerable: true });
4
11
  };
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.push = push;
7
- const chalk_1 = __importDefault(require("chalk"));
8
- const ora_1 = __importDefault(require("ora"));
9
- const child_process_1 = require("child_process");
10
- const config_1 = require("../lib/config");
11
- const api_1 = require("../lib/api");
12
+ var __copyProps = (to, from, except, desc) => {
13
+ if (from && typeof from === "object" || typeof from === "function") {
14
+ for (let key of __getOwnPropNames(from))
15
+ if (!__hasOwnProp.call(to, key) && key !== except)
16
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
17
+ }
18
+ return to;
19
+ };
20
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
21
+ // If the importer is in node compatibility mode or this is not an ESM
22
+ // file that has been converted to a CommonJS file using a Babel-
23
+ // compatible transform (i.e. "__esModule" has not been set), then set
24
+ // "default" to the CommonJS "module.exports" for node compatibility.
25
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
26
+ mod
27
+ ));
28
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
29
+ var push_exports = {};
30
+ __export(push_exports, {
31
+ push: () => push
32
+ });
33
+ module.exports = __toCommonJS(push_exports);
34
+ var import_chalk = __toESM(require("chalk"));
35
+ var import_ora = __toESM(require("ora"));
36
+ var import_child_process = require("child_process");
37
+ var import_config = require("../lib/config");
38
+ var import_api = require("../lib/api");
12
39
  async function push(branch, options) {
13
- if (!(0, config_1.isLoggedIn)()) {
14
- console.log(chalk_1.default.red('Not logged in. Run `dockup login` first.'));
15
- process.exit(1);
40
+ if (!(0, import_config.isLoggedIn)()) {
41
+ console.log(import_chalk.default.red("Not logged in. Run `dockup login` first."));
42
+ process.exit(1);
43
+ }
44
+ const config = (0, import_config.getProjectConfig)();
45
+ if (!config) {
46
+ console.log(import_chalk.default.red("Not linked to any service. Run `dockup link` first."));
47
+ process.exit(1);
48
+ }
49
+ console.log(import_chalk.default.cyan(`
50
+ Deploying to ${import_chalk.default.bold(config.projectName)}/${import_chalk.default.bold(config.serviceName)}
51
+ `));
52
+ if (!branch) {
53
+ try {
54
+ branch = (0, import_child_process.execSync)("git rev-parse --abbrev-ref HEAD", { encoding: "utf-8" }).trim();
55
+ } catch {
56
+ branch = "main";
16
57
  }
17
- const config = (0, config_1.getProjectConfig)();
18
- if (!config) {
19
- console.log(chalk_1.default.red('Not linked to any service. Run `dockup link` first.'));
20
- process.exit(1);
58
+ }
59
+ try {
60
+ const status = (0, import_child_process.execSync)("git status --porcelain", { encoding: "utf-8" }).trim();
61
+ if (status) {
62
+ console.log(import_chalk.default.yellow("\u26A0 You have uncommitted changes:"));
63
+ console.log(import_chalk.default.dim(status.split("\n").slice(0, 5).join("\n")));
64
+ if (status.split("\n").length > 5) {
65
+ console.log(import_chalk.default.dim(` ... and ${status.split("\n").length - 5} more files`));
66
+ }
67
+ console.log();
21
68
  }
22
- console.log(chalk_1.default.cyan(`\n Deploying to ${chalk_1.default.bold(config.projectName)}/${chalk_1.default.bold(config.serviceName)}\n`));
23
- // Get current branch if not specified
24
- if (!branch) {
25
- try {
26
- branch = (0, child_process_1.execSync)('git rev-parse --abbrev-ref HEAD', { encoding: 'utf-8' }).trim();
27
- }
28
- catch {
29
- branch = 'main';
30
- }
31
- }
32
- // Check for uncommitted changes
69
+ } catch {
70
+ }
71
+ if (!options?.force) {
72
+ const gitSpinner = (0, import_ora.default)(`Pushing to origin/${branch}...`).start();
33
73
  try {
34
- const status = (0, child_process_1.execSync)('git status --porcelain', { encoding: 'utf-8' }).trim();
35
- if (status) {
36
- console.log(chalk_1.default.yellow('⚠ You have uncommitted changes:'));
37
- console.log(chalk_1.default.dim(status.split('\n').slice(0, 5).join('\n')));
38
- if (status.split('\n').length > 5) {
39
- console.log(chalk_1.default.dim(` ... and ${status.split('\n').length - 5} more files`));
40
- }
41
- console.log();
42
- }
74
+ (0, import_child_process.execSync)(`git push origin ${branch}`, {
75
+ encoding: "utf-8",
76
+ stdio: ["pipe", "pipe", "pipe"]
77
+ });
78
+ gitSpinner.succeed(`Pushed to origin/${branch}`);
79
+ } catch (error) {
80
+ if (error.stderr?.includes("Everything up-to-date") || error.stdout?.includes("Everything up-to-date")) {
81
+ gitSpinner.succeed("Already up to date");
82
+ } else {
83
+ gitSpinner.warn("Git push failed (continuing with deploy)");
84
+ console.log(import_chalk.default.dim(error.message));
85
+ }
43
86
  }
44
- catch {
45
- // Not a git repo, that's fine
46
- }
47
- // Git push first (unless --force)
48
- if (!options?.force) {
49
- const gitSpinner = (0, ora_1.default)(`Pushing to origin/${branch}...`).start();
50
- try {
51
- (0, child_process_1.execSync)(`git push origin ${branch}`, {
52
- encoding: 'utf-8',
53
- stdio: ['pipe', 'pipe', 'pipe']
54
- });
55
- gitSpinner.succeed(`Pushed to origin/${branch}`);
56
- }
57
- catch (error) {
58
- // Check if it's just "Everything up-to-date"
59
- if (error.stderr?.includes('Everything up-to-date') || error.stdout?.includes('Everything up-to-date')) {
60
- gitSpinner.succeed('Already up to date');
61
- }
62
- else {
63
- gitSpinner.warn('Git push failed (continuing with deploy)');
64
- console.log(chalk_1.default.dim(error.message));
65
- }
87
+ }
88
+ const deploySpinner = (0, import_ora.default)("Triggering deployment...").start();
89
+ try {
90
+ const result = await import_api.api.deploy(config.projectSlug, config.serviceSlug, { branch });
91
+ deploySpinner.succeed("Deployment started!");
92
+ console.log(import_chalk.default.dim(`
93
+ Deployment ID: ${result.deployment?.id || "N/A"}`));
94
+ console.log(import_chalk.default.cyan("\n Building...\n"));
95
+ let lastStatus = "";
96
+ let dots = 0;
97
+ const maxPolls = 120;
98
+ let polls = 0;
99
+ while (polls < maxPolls) {
100
+ polls++;
101
+ try {
102
+ const status = await import_api.api.getServiceStatus(config.projectSlug, config.serviceSlug);
103
+ const deployment = status.deployments?.[0];
104
+ if (!deployment) {
105
+ await sleep(1e3);
106
+ continue;
66
107
  }
67
- }
68
- // Trigger deployment
69
- const deploySpinner = (0, ora_1.default)('Triggering deployment...').start();
70
- try {
71
- const result = await api_1.api.deploy(config.projectSlug, config.serviceSlug, { branch });
72
- deploySpinner.succeed('Deployment started!');
73
- console.log(chalk_1.default.dim(`\n Deployment ID: ${result.deployment?.id || 'N/A'}`));
74
- // Poll for deployment status
75
- console.log(chalk_1.default.cyan('\n Building...\n'));
76
- let lastStatus = '';
77
- let dots = 0;
78
- const maxPolls = 120; // 2 minutes max
79
- let polls = 0;
80
- while (polls < maxPolls) {
81
- polls++;
82
- try {
83
- const status = await api_1.api.getServiceStatus(config.projectSlug, config.serviceSlug);
84
- const deployment = status.deployments?.[0];
85
- if (!deployment) {
86
- await sleep(1000);
87
- continue;
88
- }
89
- const currentStatus = deployment.status;
90
- if (currentStatus !== lastStatus) {
91
- lastStatus = currentStatus;
92
- if (currentStatus === 'building') {
93
- process.stdout.write(chalk_1.default.yellow(' ⏳ Building'));
94
- }
95
- else if (currentStatus === 'deploying') {
96
- process.stdout.write(chalk_1.default.blue('\n 🚀 Deploying'));
97
- }
98
- else if (currentStatus === 'success') {
99
- console.log(chalk_1.default.green('\n\n ✓ Deployed successfully!\n'));
100
- console.log(chalk_1.default.dim(' URL: ') + chalk_1.default.cyan(`https://${status.domain}`));
101
- console.log();
102
- return;
103
- }
104
- else if (currentStatus === 'failed') {
105
- console.log(chalk_1.default.red('\n\n ✗ Deployment failed\n'));
106
- console.log(chalk_1.default.dim(' Run `dockup logs` to see error details'));
107
- console.log();
108
- process.exit(1);
109
- }
110
- }
111
- else {
112
- // Show progress dots
113
- dots++;
114
- if (dots % 3 === 0) {
115
- process.stdout.write('.');
116
- }
117
- }
118
- await sleep(1000);
119
- }
120
- catch (error) {
121
- await sleep(1000);
122
- }
108
+ const currentStatus = deployment.status;
109
+ if (currentStatus !== lastStatus) {
110
+ lastStatus = currentStatus;
111
+ if (currentStatus === "building") {
112
+ process.stdout.write(import_chalk.default.yellow(" \u23F3 Building"));
113
+ } else if (currentStatus === "deploying") {
114
+ process.stdout.write(import_chalk.default.blue("\n \u{1F680} Deploying"));
115
+ } else if (currentStatus === "success") {
116
+ console.log(import_chalk.default.green("\n\n \u2713 Deployed successfully!\n"));
117
+ console.log(import_chalk.default.dim(" URL: ") + import_chalk.default.cyan(`https://${status.domain}`));
118
+ console.log();
119
+ return;
120
+ } else if (currentStatus === "failed") {
121
+ console.log(import_chalk.default.red("\n\n \u2717 Deployment failed\n"));
122
+ console.log(import_chalk.default.dim(" Run `dockup logs` to see error details"));
123
+ console.log();
124
+ process.exit(1);
125
+ }
126
+ } else {
127
+ dots++;
128
+ if (dots % 3 === 0) {
129
+ process.stdout.write(".");
130
+ }
123
131
  }
124
- console.log(chalk_1.default.yellow('\n\n ⚠ Deployment is taking longer than expected'));
125
- console.log(chalk_1.default.dim(' Run `dockup status` to check progress'));
126
- console.log();
127
- }
128
- catch (error) {
129
- deploySpinner.fail(`Deployment failed: ${error.message}`);
130
- process.exit(1);
132
+ await sleep(1e3);
133
+ } catch (error) {
134
+ await sleep(1e3);
135
+ }
131
136
  }
137
+ console.log(import_chalk.default.yellow("\n\n \u26A0 Deployment is taking longer than expected"));
138
+ console.log(import_chalk.default.dim(" Run `dockup status` to check progress"));
139
+ console.log();
140
+ } catch (error) {
141
+ deploySpinner.fail(`Deployment failed: ${error.message}`);
142
+ process.exit(1);
143
+ }
132
144
  }
133
145
  function sleep(ms) {
134
- return new Promise(resolve => setTimeout(resolve, ms));
146
+ return new Promise((resolve) => setTimeout(resolve, ms));
135
147
  }
148
+ // Annotate the CommonJS export names for ESM import in node:
149
+ 0 && (module.exports = {
150
+ push
151
+ });
@@ -1,133 +1,157 @@
1
1
  "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
2
+ var __create = Object.create;
3
+ var __defProp = Object.defineProperty;
4
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
+ var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __getProtoOf = Object.getPrototypeOf;
7
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
8
+ var __export = (target, all) => {
9
+ for (var name in all)
10
+ __defProp(target, name, { get: all[name], enumerable: true });
4
11
  };
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.startService = startService;
7
- exports.stopService = stopService;
8
- exports.restartService = restartService;
9
- exports.deployService = deployService;
10
- exports.serviceLogs = serviceLogs;
11
- const chalk_1 = __importDefault(require("chalk"));
12
- const ora_1 = __importDefault(require("ora"));
13
- const config_1 = require("../lib/config");
14
- const api_1 = require("../lib/api");
12
+ var __copyProps = (to, from, except, desc) => {
13
+ if (from && typeof from === "object" || typeof from === "function") {
14
+ for (let key of __getOwnPropNames(from))
15
+ if (!__hasOwnProp.call(to, key) && key !== except)
16
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
17
+ }
18
+ return to;
19
+ };
20
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
21
+ // If the importer is in node compatibility mode or this is not an ESM
22
+ // file that has been converted to a CommonJS file using a Babel-
23
+ // compatible transform (i.e. "__esModule" has not been set), then set
24
+ // "default" to the CommonJS "module.exports" for node compatibility.
25
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
26
+ mod
27
+ ));
28
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
29
+ var service_exports = {};
30
+ __export(service_exports, {
31
+ deployService: () => deployService,
32
+ restartService: () => restartService,
33
+ serviceLogs: () => serviceLogs,
34
+ startService: () => startService,
35
+ stopService: () => stopService
36
+ });
37
+ module.exports = __toCommonJS(service_exports);
38
+ var import_chalk = __toESM(require("chalk"));
39
+ var import_ora = __toESM(require("ora"));
40
+ var import_config = require("../lib/config");
41
+ var import_api = require("../lib/api");
15
42
  async function getServiceContext() {
16
- const config = (0, config_1.getProjectConfig)();
17
- if (!config) {
18
- console.log(chalk_1.default.red('Not linked to any service. Run `dockup link` first.'));
19
- return null;
20
- }
21
- return { projectSlug: config.projectSlug, serviceSlug: config.serviceSlug };
43
+ const config = (0, import_config.getProjectConfig)();
44
+ if (!config) {
45
+ console.log(import_chalk.default.red("Not linked to any service. Run `dockup link` first."));
46
+ return null;
47
+ }
48
+ return { projectSlug: config.projectSlug, serviceSlug: config.serviceSlug };
22
49
  }
23
50
  async function startService() {
24
- if (!(0, config_1.isLoggedIn)()) {
25
- console.log(chalk_1.default.red('Not logged in. Run `dockup login` first.'));
26
- process.exit(1);
27
- }
28
- const ctx = await getServiceContext();
29
- if (!ctx)
30
- process.exit(1);
31
- const spinner = (0, ora_1.default)('Starting service...').start();
32
- try {
33
- await api_1.api.post(`/projects/${ctx.projectSlug}/services/${ctx.serviceSlug}/start`);
34
- spinner.succeed('Service started!');
35
- }
36
- catch (error) {
37
- spinner.fail(`Failed to start: ${error.message}`);
38
- process.exit(1);
39
- }
51
+ if (!(0, import_config.isLoggedIn)()) {
52
+ console.log(import_chalk.default.red("Not logged in. Run `dockup login` first."));
53
+ process.exit(1);
54
+ }
55
+ const ctx = await getServiceContext();
56
+ if (!ctx) process.exit(1);
57
+ const spinner = (0, import_ora.default)("Starting service...").start();
58
+ try {
59
+ await import_api.api.post(`/projects/${ctx.projectSlug}/services/${ctx.serviceSlug}/start`);
60
+ spinner.succeed("Service started!");
61
+ } catch (error) {
62
+ spinner.fail(`Failed to start: ${error.message}`);
63
+ process.exit(1);
64
+ }
40
65
  }
41
66
  async function stopService() {
42
- if (!(0, config_1.isLoggedIn)()) {
43
- console.log(chalk_1.default.red('Not logged in. Run `dockup login` first.'));
44
- process.exit(1);
45
- }
46
- const ctx = await getServiceContext();
47
- if (!ctx)
48
- process.exit(1);
49
- const spinner = (0, ora_1.default)('Stopping service...').start();
50
- try {
51
- await api_1.api.post(`/projects/${ctx.projectSlug}/services/${ctx.serviceSlug}/stop`);
52
- spinner.succeed('Service stopped!');
53
- }
54
- catch (error) {
55
- spinner.fail(`Failed to stop: ${error.message}`);
56
- process.exit(1);
57
- }
67
+ if (!(0, import_config.isLoggedIn)()) {
68
+ console.log(import_chalk.default.red("Not logged in. Run `dockup login` first."));
69
+ process.exit(1);
70
+ }
71
+ const ctx = await getServiceContext();
72
+ if (!ctx) process.exit(1);
73
+ const spinner = (0, import_ora.default)("Stopping service...").start();
74
+ try {
75
+ await import_api.api.post(`/projects/${ctx.projectSlug}/services/${ctx.serviceSlug}/stop`);
76
+ spinner.succeed("Service stopped!");
77
+ } catch (error) {
78
+ spinner.fail(`Failed to stop: ${error.message}`);
79
+ process.exit(1);
80
+ }
58
81
  }
59
82
  async function restartService() {
60
- if (!(0, config_1.isLoggedIn)()) {
61
- console.log(chalk_1.default.red('Not logged in. Run `dockup login` first.'));
62
- process.exit(1);
63
- }
64
- const ctx = await getServiceContext();
65
- if (!ctx)
66
- process.exit(1);
67
- const spinner = (0, ora_1.default)('Restarting service...').start();
68
- try {
69
- await api_1.api.post(`/projects/${ctx.projectSlug}/services/${ctx.serviceSlug}/restart`);
70
- spinner.succeed('Service restarted!');
71
- }
72
- catch (error) {
73
- spinner.fail(`Failed to restart: ${error.message}`);
74
- process.exit(1);
75
- }
83
+ if (!(0, import_config.isLoggedIn)()) {
84
+ console.log(import_chalk.default.red("Not logged in. Run `dockup login` first."));
85
+ process.exit(1);
86
+ }
87
+ const ctx = await getServiceContext();
88
+ if (!ctx) process.exit(1);
89
+ const spinner = (0, import_ora.default)("Restarting service...").start();
90
+ try {
91
+ await import_api.api.post(`/projects/${ctx.projectSlug}/services/${ctx.serviceSlug}/restart`);
92
+ spinner.succeed("Service restarted!");
93
+ } catch (error) {
94
+ spinner.fail(`Failed to restart: ${error.message}`);
95
+ process.exit(1);
96
+ }
76
97
  }
77
98
  async function deployService() {
78
- if (!(0, config_1.isLoggedIn)()) {
79
- console.log(chalk_1.default.red('Not logged in. Run `dockup login` first.'));
80
- process.exit(1);
81
- }
82
- const ctx = await getServiceContext();
83
- if (!ctx)
84
- process.exit(1);
85
- const spinner = (0, ora_1.default)('Triggering deployment...').start();
86
- try {
87
- const result = await api_1.api.deploy(ctx.projectSlug, ctx.serviceSlug);
88
- spinner.succeed('Deployment started!');
89
- console.log(chalk_1.default.dim(`\n Deployment ID: ${result.deploymentId || 'N/A'}`));
90
- console.log(chalk_1.default.dim(' Run `dockup logs` to watch progress\n'));
91
- }
92
- catch (error) {
93
- spinner.fail(`Failed to deploy: ${error.message}`);
94
- process.exit(1);
95
- }
99
+ if (!(0, import_config.isLoggedIn)()) {
100
+ console.log(import_chalk.default.red("Not logged in. Run `dockup login` first."));
101
+ process.exit(1);
102
+ }
103
+ const ctx = await getServiceContext();
104
+ if (!ctx) process.exit(1);
105
+ const spinner = (0, import_ora.default)("Triggering deployment...").start();
106
+ try {
107
+ const result = await import_api.api.deploy(ctx.projectSlug, ctx.serviceSlug);
108
+ spinner.succeed("Deployment started!");
109
+ console.log(import_chalk.default.dim(`
110
+ Deployment ID: ${result.deploymentId || "N/A"}`));
111
+ console.log(import_chalk.default.dim(" Run `dockup logs` to watch progress\n"));
112
+ } catch (error) {
113
+ spinner.fail(`Failed to deploy: ${error.message}`);
114
+ process.exit(1);
115
+ }
96
116
  }
97
117
  async function serviceLogs(options) {
98
- if (!(0, config_1.isLoggedIn)()) {
99
- console.log(chalk_1.default.red('Not logged in. Run `dockup login` first.'));
100
- process.exit(1);
101
- }
102
- const ctx = await getServiceContext();
103
- if (!ctx)
104
- process.exit(1);
105
- const spinner = (0, ora_1.default)('Fetching logs...').start();
106
- try {
107
- const lines = parseInt(options.tail || '100', 10);
108
- const logs = await api_1.api.get(`/projects/${ctx.projectSlug}/services/${ctx.serviceSlug}/logs?lines=${lines}`);
109
- spinner.stop();
110
- if (!logs.logs || logs.logs.length === 0) {
111
- console.log(chalk_1.default.yellow('\n No logs available\n'));
112
- return;
113
- }
114
- console.log(chalk_1.default.cyan('\n Service Logs:\n'));
115
- const logLines = logs.logs.split('\n');
116
- for (const line of logLines) {
117
- if (line.toLowerCase().includes('error')) {
118
- console.log(chalk_1.default.red(` ${line}`));
119
- }
120
- else if (line.toLowerCase().includes('warn')) {
121
- console.log(chalk_1.default.yellow(` ${line}`));
122
- }
123
- else {
124
- console.log(chalk_1.default.dim(` ${line}`));
125
- }
126
- }
127
- console.log();
128
- }
129
- catch (error) {
130
- spinner.fail(`Failed to fetch logs: ${error.message}`);
131
- process.exit(1);
132
- }
118
+ if (!(0, import_config.isLoggedIn)()) {
119
+ console.log(import_chalk.default.red("Not logged in. Run `dockup login` first."));
120
+ process.exit(1);
121
+ }
122
+ const ctx = await getServiceContext();
123
+ if (!ctx) process.exit(1);
124
+ const spinner = (0, import_ora.default)("Fetching logs...").start();
125
+ try {
126
+ const lines = parseInt(options.tail || "100", 10);
127
+ const logs = await import_api.api.get(`/projects/${ctx.projectSlug}/services/${ctx.serviceSlug}/logs?lines=${lines}`);
128
+ spinner.stop();
129
+ if (!logs.logs || logs.logs.length === 0) {
130
+ console.log(import_chalk.default.yellow("\n No logs available\n"));
131
+ return;
132
+ }
133
+ console.log(import_chalk.default.cyan("\n Service Logs:\n"));
134
+ const logLines = logs.logs.split("\n");
135
+ for (const line of logLines) {
136
+ if (line.toLowerCase().includes("error")) {
137
+ console.log(import_chalk.default.red(` ${line}`));
138
+ } else if (line.toLowerCase().includes("warn")) {
139
+ console.log(import_chalk.default.yellow(` ${line}`));
140
+ } else {
141
+ console.log(import_chalk.default.dim(` ${line}`));
142
+ }
143
+ }
144
+ console.log();
145
+ } catch (error) {
146
+ spinner.fail(`Failed to fetch logs: ${error.message}`);
147
+ process.exit(1);
148
+ }
133
149
  }
150
+ // Annotate the CommonJS export names for ESM import in node:
151
+ 0 && (module.exports = {
152
+ deployService,
153
+ restartService,
154
+ serviceLogs,
155
+ startService,
156
+ stopService
157
+ });