@mono-labs/cli 0.0.124 ā 0.0.125
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/lib/commands/dev/dev-editor.js +10 -16
- package/package.json +1 -1
|
@@ -125,8 +125,7 @@ function childManager(
|
|
|
125
125
|
}
|
|
126
126
|
|
|
127
127
|
child.on('sigint', (code) => {
|
|
128
|
-
|
|
129
|
-
|
|
128
|
+
console.log(
|
|
130
129
|
`\n${service.icon || 'š'} ${service.name || 'Service'} exited with code ${code}`
|
|
131
130
|
);
|
|
132
131
|
if (restartCallback) restartCallback();
|
|
@@ -134,9 +133,6 @@ function childManager(
|
|
|
134
133
|
|
|
135
134
|
child.on('exit', (code) => {
|
|
136
135
|
if (!serviceSigInt[service.name] && restartCallback) {
|
|
137
|
-
|
|
138
|
-
`\n${service.icon || 'š'} ${service.name || 'Service'} exited with code ${code}\n`
|
|
139
|
-
);
|
|
140
136
|
restartCallback();
|
|
141
137
|
}
|
|
142
138
|
});
|
|
@@ -168,7 +164,7 @@ export async function dev(_forceProd, useAtlas, argServices, stage) {
|
|
|
168
164
|
getPrepServices().forEach((key) => {
|
|
169
165
|
const { command, stdio } = devServices[key];
|
|
170
166
|
if (acceptedServices.includes(key)) {
|
|
171
|
-
|
|
167
|
+
console.log(`Running command for service ${key}: ${command}`);
|
|
172
168
|
const child = spawn(command, {
|
|
173
169
|
stdio: ['pipe', 'inherit', 'pipe'], // Read from terminal, but capture output
|
|
174
170
|
shell: true,
|
|
@@ -178,10 +174,10 @@ export async function dev(_forceProd, useAtlas, argServices, stage) {
|
|
|
178
174
|
});
|
|
179
175
|
if (key === 'app') {
|
|
180
176
|
child.on('sigint', () => {
|
|
181
|
-
|
|
177
|
+
console.log('SIGINT received for app service');
|
|
182
178
|
});
|
|
183
179
|
child.on('exit', () => {
|
|
184
|
-
|
|
180
|
+
console.log('exit received for app service');
|
|
185
181
|
});
|
|
186
182
|
}
|
|
187
183
|
|
|
@@ -194,8 +190,8 @@ export async function dev(_forceProd, useAtlas, argServices, stage) {
|
|
|
194
190
|
try {
|
|
195
191
|
ngrokUrl = (await getNgrokUrl()) + '/';
|
|
196
192
|
} catch (e) {
|
|
197
|
-
|
|
198
|
-
|
|
193
|
+
console.log('Ngrok failed to start. Retrying in 2 seconds...');
|
|
194
|
+
console.log(e);
|
|
199
195
|
await new Promise((res) => setTimeout(res, 2000)); // Delay before retry
|
|
200
196
|
}
|
|
201
197
|
}
|
|
@@ -214,8 +210,6 @@ export async function dev(_forceProd, useAtlas, argServices, stage) {
|
|
|
214
210
|
|
|
215
211
|
setTimeout(
|
|
216
212
|
() => {
|
|
217
|
-
|
|
218
|
-
|
|
219
213
|
getContinuedServices().forEach((key) => {
|
|
220
214
|
if (stage && key === 'app') {
|
|
221
215
|
startService(key, forceProd, ngrokUrl, stage, envObj);
|
|
@@ -230,7 +224,7 @@ export async function dev(_forceProd, useAtlas, argServices, stage) {
|
|
|
230
224
|
);
|
|
231
225
|
|
|
232
226
|
async function shutdown() {
|
|
233
|
-
|
|
227
|
+
console.log('\nš Shutting down all services...');
|
|
234
228
|
for (const [key, child] of Object.entries(childProcesses)) {
|
|
235
229
|
if (
|
|
236
230
|
child &&
|
|
@@ -239,11 +233,11 @@ export async function dev(_forceProd, useAtlas, argServices, stage) {
|
|
|
239
233
|
devServices[key].continue &&
|
|
240
234
|
!['docker'].includes(key)
|
|
241
235
|
) {
|
|
242
|
-
|
|
236
|
+
console.log(`ā Killing service: ${key}`);
|
|
243
237
|
await new Promise((resolve) => {
|
|
244
238
|
treeKill(child.pid, 'SIGTERM', (err) => {
|
|
245
239
|
if (!err) {
|
|
246
|
-
|
|
240
|
+
console.log(`ā
${key} has been tree-killed.`);
|
|
247
241
|
}
|
|
248
242
|
resolve();
|
|
249
243
|
});
|
|
@@ -271,6 +265,6 @@ export async function dev(_forceProd, useAtlas, argServices, stage) {
|
|
|
271
265
|
|
|
272
266
|
// Exit signal
|
|
273
267
|
process.on('exit', () => {
|
|
274
|
-
|
|
268
|
+
console.log('š Process exiting...');
|
|
275
269
|
});
|
|
276
270
|
}
|