cdd-cli 3.2.0 → 3.2.2
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/.atl/skill-registry.md +30 -0
- package/.editorconfig +12 -0
- package/.eslintrc.json +1 -1
- package/.prettierignore +4 -0
- package/.prettierrc +8 -0
- package/CHANGELOG.md +29 -0
- package/SECURITY.md +5 -0
- package/__mocks__/ink.cjs +17 -0
- package/coverage/clover.xml +526 -436
- package/coverage/coverage-final.json +19 -15
- package/coverage/lcov-report/components/ContainerCreationPrompt.jsx.html +376 -0
- package/coverage/lcov-report/components/PromptField.jsx.html +229 -0
- package/coverage/lcov-report/components/SuggestionPanel.jsx.html +244 -0
- package/coverage/lcov-report/components/index.html +146 -0
- package/coverage/lcov-report/helpers/constants.js.html +80 -17
- package/coverage/lcov-report/helpers/containerOptionsBuilder.js.html +41 -8
- package/coverage/lcov-report/helpers/dockerService/serviceComponents/containerActions.js.html +162 -84
- package/coverage/lcov-report/helpers/dockerService/serviceComponents/containerList.js.html +50 -32
- package/coverage/lcov-report/helpers/dockerService/serviceComponents/index.html +21 -21
- package/coverage/lcov-report/helpers/imageNameUtils.js.html +181 -0
- package/coverage/lcov-report/helpers/index.html +27 -12
- package/coverage/lcov-report/helpers/logger.js.html +19 -19
- package/coverage/lcov-report/helpers/safeCall.js.html +3 -3
- package/coverage/lcov-report/helpers/validationHelpers.js.html +28 -76
- package/coverage/lcov-report/hooks/creation/index.html +20 -20
- package/coverage/lcov-report/hooks/creation/useContainerActions.js.html +38 -17
- package/coverage/lcov-report/hooks/creation/useContainerCreation.js.html +416 -89
- package/coverage/lcov-report/hooks/creation/useLogsViewer.js.html +7 -7
- package/coverage/lcov-report/hooks/debug/index.html +5 -5
- package/coverage/lcov-report/hooks/debug/useDebugLogs.js.html +35 -20
- package/coverage/lcov-report/hooks/index.html +40 -40
- package/coverage/lcov-report/hooks/navigation/index.html +19 -19
- package/coverage/lcov-report/hooks/navigation/useContainerSelection.js.html +38 -29
- package/coverage/lcov-report/hooks/useContainerCommandRouter.js.html +119 -80
- package/coverage/lcov-report/hooks/useControls.js.html +263 -122
- package/coverage/lcov-report/hooks/useEraseConfirmation.js.html +8 -8
- package/coverage/lcov-report/hooks/useExitHandler.js.html +50 -41
- package/coverage/lcov-report/index.html +67 -52
- package/coverage/lcov.info +991 -805
- package/dist/App.js +11 -11
- package/dist/components/ContainerCreationPrompt.js +31 -10
- package/dist/components/ContainerList.js +3 -3
- package/dist/components/ContainerRow.js +20 -20
- package/dist/components/ContainerSection.js +3 -3
- package/dist/components/Footer.js +2 -2
- package/dist/components/Header.js +7 -7
- package/dist/components/LogViewer.js +3 -3
- package/dist/components/MessageFeedback.js +2 -2
- package/dist/components/PromptField.js +4 -4
- package/dist/components/StatsBar.js +5 -5
- package/dist/components/SuggestionPanel.js +44 -0
- package/dist/components/UsageMenu.js +3 -3
- package/dist/helpers/appInfo.js +7 -7
- package/dist/helpers/constants.js +114 -0
- package/dist/helpers/containerOptionsBuilder.js +3 -3
- package/dist/helpers/dockerService/dockerService.js +1 -1
- package/dist/helpers/dockerService/serviceComponents/containerActions.js +99 -40
- package/dist/helpers/dockerService/serviceComponents/containerList.js +11 -11
- package/dist/helpers/dockerService/serviceComponents/containerLogs.js +9 -9
- package/dist/helpers/dockerService/serviceComponents/containerStats.js +5 -5
- package/dist/helpers/dockerService/serviceComponents/imageUtils.js +1 -1
- package/dist/helpers/exitWithMessage.js +10 -10
- package/dist/helpers/imageNameUtils.js +32 -0
- package/dist/helpers/logger.js +13 -13
- package/dist/helpers/safeCall.js +2 -2
- package/dist/helpers/validationHelpers.js +76 -21
- package/dist/hooks/creation/useContainerActions.js +9 -9
- package/dist/hooks/creation/useContainerCreation.js +138 -36
- package/dist/hooks/creation/useLogsViewer.js +2 -2
- package/dist/hooks/debug/useDebugLogs.js +4 -4
- package/dist/hooks/useContainerCommandRouter.js +13 -13
- package/dist/hooks/useContainers.js +3 -3
- package/dist/hooks/useControls.js +66 -35
- package/dist/hooks/useEraseConfirmation.js +3 -3
- package/dist/index.js +2 -2
- package/jest.config.cjs +7 -0
- package/package.json +7 -3
- package/src/App.jsx +33 -16
- package/src/components/ContainerCreationPrompt.jsx +43 -9
- package/src/components/ContainerList.jsx +3 -3
- package/src/components/ContainerRow.jsx +19 -16
- package/src/components/ContainerSection.jsx +3 -3
- package/src/components/Footer.jsx +2 -2
- package/src/components/Header.jsx +7 -7
- package/src/components/LogViewer.jsx +5 -3
- package/src/components/MessageFeedback.jsx +2 -2
- package/src/components/PromptField.jsx +4 -4
- package/src/components/StatsBar.jsx +11 -7
- package/src/components/SuggestionPanel.jsx +53 -0
- package/src/components/UsageMenu.jsx +18 -13
- package/src/helpers/appInfo.js +7 -7
- package/src/helpers/constants.js +30 -9
- package/src/helpers/containerOptionsBuilder.js +16 -5
- package/src/helpers/dockerService/dockerService.js +1 -1
- package/src/helpers/dockerService/serviceComponents/containerActions.js +87 -61
- package/src/helpers/dockerService/serviceComponents/containerList.js +31 -25
- package/src/helpers/dockerService/serviceComponents/containerLogs.js +41 -26
- package/src/helpers/dockerService/serviceComponents/containerStats.js +13 -11
- package/src/helpers/dockerService/serviceComponents/imageUtils.js +5 -4
- package/src/helpers/exitWithMessage.js +13 -7
- package/src/helpers/imageNameUtils.js +32 -0
- package/src/helpers/logger.js +15 -15
- package/src/helpers/safeCall.js +2 -2
- package/src/helpers/validationHelpers.js +13 -29
- package/src/hooks/creation/useContainerActions.js +19 -12
- package/src/hooks/creation/useContainerCreation.js +150 -41
- package/src/hooks/creation/useLogsViewer.js +2 -2
- package/src/hooks/debug/useDebugLogs.js +15 -10
- package/src/hooks/navigation/useContainerSelection.js +17 -14
- package/src/hooks/useContainerCommandRouter.js +71 -58
- package/src/hooks/useContainers.js +4 -4
- package/src/hooks/useControls.js +115 -68
- package/src/hooks/useEraseConfirmation.js +3 -3
- package/src/hooks/useExitHandler.js +29 -26
- package/src/index.js +4 -4
- package/test/ContainerCreationPrompt.dom.test.js +68 -0
- package/test/SuggestionPanel.dom.test.js +53 -0
- package/test/constants.test.js +34 -0
- package/test/useContainerCreation.dom.test.js +123 -0
- package/test/useControls.dom.test.js +198 -2
|
@@ -23,30 +23,30 @@
|
|
|
23
23
|
<div class='clearfix'>
|
|
24
24
|
|
|
25
25
|
<div class='fl pad1y space-right2'>
|
|
26
|
-
<span class="strong">
|
|
26
|
+
<span class="strong">56.48% </span>
|
|
27
27
|
<span class="quiet">Statements</span>
|
|
28
|
-
<span class='fraction'>
|
|
28
|
+
<span class='fraction'>61/108</span>
|
|
29
29
|
</div>
|
|
30
30
|
|
|
31
31
|
|
|
32
32
|
<div class='fl pad1y space-right2'>
|
|
33
|
-
<span class="strong">
|
|
33
|
+
<span class="strong">61.33% </span>
|
|
34
34
|
<span class="quiet">Branches</span>
|
|
35
|
-
<span class='fraction'>
|
|
35
|
+
<span class='fraction'>46/75</span>
|
|
36
36
|
</div>
|
|
37
37
|
|
|
38
38
|
|
|
39
39
|
<div class='fl pad1y space-right2'>
|
|
40
|
-
<span class="strong">
|
|
40
|
+
<span class="strong">26.08% </span>
|
|
41
41
|
<span class="quiet">Functions</span>
|
|
42
|
-
<span class='fraction'>
|
|
42
|
+
<span class='fraction'>6/23</span>
|
|
43
43
|
</div>
|
|
44
44
|
|
|
45
45
|
|
|
46
46
|
<div class='fl pad1y space-right2'>
|
|
47
|
-
<span class="strong">
|
|
47
|
+
<span class="strong">60.39% </span>
|
|
48
48
|
<span class="quiet">Lines</span>
|
|
49
|
-
<span class='fraction'>
|
|
49
|
+
<span class='fraction'>61/101</span>
|
|
50
50
|
</div>
|
|
51
51
|
|
|
52
52
|
|
|
@@ -61,7 +61,7 @@
|
|
|
61
61
|
</div>
|
|
62
62
|
</template>
|
|
63
63
|
</div>
|
|
64
|
-
<div class='status-line
|
|
64
|
+
<div class='status-line medium'></div>
|
|
65
65
|
<pre><table class="coverage">
|
|
66
66
|
<tr><td class="line-count quiet"><a name='L1'></a><a href='#L1'>1</a>
|
|
67
67
|
<a name='L2'></a><a href='#L2'>2</a>
|
|
@@ -263,7 +263,54 @@
|
|
|
263
263
|
<a name='L198'></a><a href='#L198'>198</a>
|
|
264
264
|
<a name='L199'></a><a href='#L199'>199</a>
|
|
265
265
|
<a name='L200'></a><a href='#L200'>200</a>
|
|
266
|
-
<a name='L201'></a><a href='#L201'>201</a
|
|
266
|
+
<a name='L201'></a><a href='#L201'>201</a>
|
|
267
|
+
<a name='L202'></a><a href='#L202'>202</a>
|
|
268
|
+
<a name='L203'></a><a href='#L203'>203</a>
|
|
269
|
+
<a name='L204'></a><a href='#L204'>204</a>
|
|
270
|
+
<a name='L205'></a><a href='#L205'>205</a>
|
|
271
|
+
<a name='L206'></a><a href='#L206'>206</a>
|
|
272
|
+
<a name='L207'></a><a href='#L207'>207</a>
|
|
273
|
+
<a name='L208'></a><a href='#L208'>208</a>
|
|
274
|
+
<a name='L209'></a><a href='#L209'>209</a>
|
|
275
|
+
<a name='L210'></a><a href='#L210'>210</a>
|
|
276
|
+
<a name='L211'></a><a href='#L211'>211</a>
|
|
277
|
+
<a name='L212'></a><a href='#L212'>212</a>
|
|
278
|
+
<a name='L213'></a><a href='#L213'>213</a>
|
|
279
|
+
<a name='L214'></a><a href='#L214'>214</a>
|
|
280
|
+
<a name='L215'></a><a href='#L215'>215</a>
|
|
281
|
+
<a name='L216'></a><a href='#L216'>216</a>
|
|
282
|
+
<a name='L217'></a><a href='#L217'>217</a>
|
|
283
|
+
<a name='L218'></a><a href='#L218'>218</a>
|
|
284
|
+
<a name='L219'></a><a href='#L219'>219</a>
|
|
285
|
+
<a name='L220'></a><a href='#L220'>220</a>
|
|
286
|
+
<a name='L221'></a><a href='#L221'>221</a>
|
|
287
|
+
<a name='L222'></a><a href='#L222'>222</a>
|
|
288
|
+
<a name='L223'></a><a href='#L223'>223</a>
|
|
289
|
+
<a name='L224'></a><a href='#L224'>224</a>
|
|
290
|
+
<a name='L225'></a><a href='#L225'>225</a>
|
|
291
|
+
<a name='L226'></a><a href='#L226'>226</a>
|
|
292
|
+
<a name='L227'></a><a href='#L227'>227</a>
|
|
293
|
+
<a name='L228'></a><a href='#L228'>228</a>
|
|
294
|
+
<a name='L229'></a><a href='#L229'>229</a>
|
|
295
|
+
<a name='L230'></a><a href='#L230'>230</a>
|
|
296
|
+
<a name='L231'></a><a href='#L231'>231</a>
|
|
297
|
+
<a name='L232'></a><a href='#L232'>232</a>
|
|
298
|
+
<a name='L233'></a><a href='#L233'>233</a>
|
|
299
|
+
<a name='L234'></a><a href='#L234'>234</a>
|
|
300
|
+
<a name='L235'></a><a href='#L235'>235</a>
|
|
301
|
+
<a name='L236'></a><a href='#L236'>236</a>
|
|
302
|
+
<a name='L237'></a><a href='#L237'>237</a>
|
|
303
|
+
<a name='L238'></a><a href='#L238'>238</a>
|
|
304
|
+
<a name='L239'></a><a href='#L239'>239</a>
|
|
305
|
+
<a name='L240'></a><a href='#L240'>240</a>
|
|
306
|
+
<a name='L241'></a><a href='#L241'>241</a>
|
|
307
|
+
<a name='L242'></a><a href='#L242'>242</a>
|
|
308
|
+
<a name='L243'></a><a href='#L243'>243</a>
|
|
309
|
+
<a name='L244'></a><a href='#L244'>244</a>
|
|
310
|
+
<a name='L245'></a><a href='#L245'>245</a>
|
|
311
|
+
<a name='L246'></a><a href='#L246'>246</a>
|
|
312
|
+
<a name='L247'></a><a href='#L247'>247</a>
|
|
313
|
+
<a name='L248'></a><a href='#L248'>248</a></td><td class="line-coverage quiet"><span class="cline-any cline-neutral"> </span>
|
|
267
314
|
<span class="cline-any cline-neutral"> </span>
|
|
268
315
|
<span class="cline-any cline-neutral"> </span>
|
|
269
316
|
<span class="cline-any cline-neutral"> </span>
|
|
@@ -287,22 +334,31 @@
|
|
|
287
334
|
<span class="cline-any cline-neutral"> </span>
|
|
288
335
|
<span class="cline-any cline-neutral"> </span>
|
|
289
336
|
<span class="cline-any cline-neutral"> </span>
|
|
290
|
-
<span class="cline-any cline-yes">
|
|
337
|
+
<span class="cline-any cline-yes">84x</span>
|
|
291
338
|
<span class="cline-any cline-neutral"> </span>
|
|
292
339
|
<span class="cline-any cline-neutral"> </span>
|
|
293
|
-
<span class="cline-any cline-yes">
|
|
340
|
+
<span class="cline-any cline-yes">84x</span>
|
|
294
341
|
<span class="cline-any cline-neutral"> </span>
|
|
295
|
-
<span class="cline-any cline-yes">
|
|
342
|
+
<span class="cline-any cline-yes">84x</span>
|
|
296
343
|
<span class="cline-any cline-neutral"> </span>
|
|
297
344
|
<span class="cline-any cline-yes">4x</span>
|
|
345
|
+
<span class="cline-any cline-neutral"> </span>
|
|
346
|
+
<span class="cline-any cline-neutral"> </span>
|
|
347
|
+
<span class="cline-any cline-neutral"> </span>
|
|
348
|
+
<span class="cline-any cline-neutral"> </span>
|
|
349
|
+
<span class="cline-any cline-neutral"> </span>
|
|
298
350
|
<span class="cline-any cline-yes">4x</span>
|
|
299
351
|
<span class="cline-any cline-yes">4x</span>
|
|
300
352
|
<span class="cline-any cline-yes">4x</span>
|
|
301
353
|
<span class="cline-any cline-yes">4x</span>
|
|
302
354
|
<span class="cline-any cline-yes">3x</span>
|
|
303
355
|
<span class="cline-any cline-yes">3x</span>
|
|
356
|
+
<span class="cline-any cline-yes">2x</span>
|
|
357
|
+
<span class="cline-any cline-neutral"> </span>
|
|
358
|
+
<span class="cline-any cline-neutral"> </span>
|
|
304
359
|
<span class="cline-any cline-yes">3x</span>
|
|
305
360
|
<span class="cline-any cline-neutral"> </span>
|
|
361
|
+
<span class="cline-any cline-neutral"> </span>
|
|
306
362
|
<span class="cline-any cline-yes">3x</span>
|
|
307
363
|
<span class="cline-any cline-yes">3x</span>
|
|
308
364
|
<span class="cline-any cline-neutral"> </span>
|
|
@@ -316,11 +372,11 @@
|
|
|
316
372
|
<span class="cline-any cline-neutral"> </span>
|
|
317
373
|
<span class="cline-any cline-neutral"> </span>
|
|
318
374
|
<span class="cline-any cline-neutral"> </span>
|
|
319
|
-
<span class="cline-any cline-yes">
|
|
320
|
-
<span class="cline-any cline-yes">
|
|
321
|
-
<span class="cline-any cline-yes">
|
|
375
|
+
<span class="cline-any cline-yes">84x</span>
|
|
376
|
+
<span class="cline-any cline-yes">84x</span>
|
|
377
|
+
<span class="cline-any cline-yes">84x</span>
|
|
322
378
|
<span class="cline-any cline-neutral"> </span>
|
|
323
|
-
<span class="cline-any cline-yes">
|
|
379
|
+
<span class="cline-any cline-yes">84x</span>
|
|
324
380
|
<span class="cline-any cline-neutral"> </span>
|
|
325
381
|
<span class="cline-any cline-no"> </span>
|
|
326
382
|
<span class="cline-any cline-no"> </span>
|
|
@@ -339,19 +395,24 @@
|
|
|
339
395
|
<span class="cline-any cline-neutral"> </span>
|
|
340
396
|
<span class="cline-any cline-neutral"> </span>
|
|
341
397
|
<span class="cline-any cline-neutral"> </span>
|
|
342
|
-
<span class="cline-any cline-yes">
|
|
398
|
+
<span class="cline-any cline-yes">84x</span>
|
|
399
|
+
<span class="cline-any cline-neutral"> </span>
|
|
343
400
|
<span class="cline-any cline-no"> </span>
|
|
344
401
|
<span class="cline-any cline-neutral"> </span>
|
|
402
|
+
<span class="cline-any cline-neutral"> </span>
|
|
345
403
|
<span class="cline-any cline-no"> </span>
|
|
346
404
|
<span class="cline-any cline-no"> </span>
|
|
347
405
|
<span class="cline-any cline-no"> </span>
|
|
348
406
|
<span class="cline-any cline-neutral"> </span>
|
|
349
407
|
<span class="cline-any cline-neutral"> </span>
|
|
408
|
+
<span class="cline-any cline-neutral"> </span>
|
|
350
409
|
<span class="cline-any cline-no"> </span>
|
|
351
410
|
<span class="cline-any cline-neutral"> </span>
|
|
352
411
|
<span class="cline-any cline-neutral"> </span>
|
|
353
412
|
<span class="cline-any cline-neutral"> </span>
|
|
354
|
-
<span class="cline-any cline-
|
|
413
|
+
<span class="cline-any cline-neutral"> </span>
|
|
414
|
+
<span class="cline-any cline-neutral"> </span>
|
|
415
|
+
<span class="cline-any cline-yes">84x</span>
|
|
355
416
|
<span class="cline-any cline-neutral"> </span>
|
|
356
417
|
<span class="cline-any cline-neutral"> </span>
|
|
357
418
|
<span class="cline-any cline-neutral"> </span>
|
|
@@ -361,13 +422,15 @@
|
|
|
361
422
|
<span class="cline-any cline-neutral"> </span>
|
|
362
423
|
<span class="cline-any cline-no"> </span>
|
|
363
424
|
<span class="cline-any cline-no"> </span>
|
|
364
|
-
<span class="cline-any cline-
|
|
425
|
+
<span class="cline-any cline-neutral"> </span>
|
|
365
426
|
<span class="cline-any cline-neutral"> </span>
|
|
366
427
|
<span class="cline-any cline-no"> </span>
|
|
428
|
+
<span class="cline-any cline-neutral"> </span>
|
|
367
429
|
<span class="cline-any cline-no"> </span>
|
|
430
|
+
<span class="cline-any cline-yes">8x</span>
|
|
368
431
|
<span class="cline-any cline-neutral"> </span>
|
|
369
432
|
<span class="cline-any cline-neutral"> </span>
|
|
370
|
-
<span class="cline-any cline-yes">
|
|
433
|
+
<span class="cline-any cline-yes">84x</span>
|
|
371
434
|
<span class="cline-any cline-neutral"> </span>
|
|
372
435
|
<span class="cline-any cline-no"> </span>
|
|
373
436
|
<span class="cline-any cline-no"> </span>
|
|
@@ -379,69 +442,100 @@
|
|
|
379
442
|
<span class="cline-any cline-neutral"> </span>
|
|
380
443
|
<span class="cline-any cline-neutral"> </span>
|
|
381
444
|
<span class="cline-any cline-neutral"> </span>
|
|
382
|
-
<span class="cline-any cline-yes">
|
|
383
|
-
<span class="cline-any cline-no"> </span>
|
|
445
|
+
<span class="cline-any cline-yes">84x</span>
|
|
384
446
|
<span class="cline-any cline-neutral"> </span>
|
|
385
|
-
<span class="cline-any cline-
|
|
386
|
-
<span class="cline-any cline-no"> </span>
|
|
447
|
+
<span class="cline-any cline-yes">22x</span>
|
|
387
448
|
<span class="cline-any cline-neutral"> </span>
|
|
449
|
+
<span class="cline-any cline-yes">22x</span>
|
|
388
450
|
<span class="cline-any cline-no"> </span>
|
|
451
|
+
<span class="cline-any cline-yes">22x</span>
|
|
452
|
+
<span class="cline-any cline-neutral"> </span>
|
|
453
|
+
<span class="cline-any cline-yes">22x</span>
|
|
389
454
|
<span class="cline-any cline-no"> </span>
|
|
390
455
|
<span class="cline-any cline-no"> </span>
|
|
391
456
|
<span class="cline-any cline-no"> </span>
|
|
392
457
|
<span class="cline-any cline-neutral"> </span>
|
|
393
458
|
<span class="cline-any cline-neutral"> </span>
|
|
394
|
-
<span class="cline-any cline-
|
|
395
|
-
<span class="cline-any cline-
|
|
396
|
-
<span class="cline-any cline-
|
|
459
|
+
<span class="cline-any cline-yes">22x</span>
|
|
460
|
+
<span class="cline-any cline-neutral"> </span>
|
|
461
|
+
<span class="cline-any cline-yes">5x</span>
|
|
462
|
+
<span class="cline-any cline-yes">2x</span>
|
|
463
|
+
<span class="cline-any cline-yes">2x</span>
|
|
464
|
+
<span class="cline-any cline-neutral"> </span>
|
|
465
|
+
<span class="cline-any cline-yes">3x</span>
|
|
466
|
+
<span class="cline-any cline-yes">3x</span>
|
|
467
|
+
<span class="cline-any cline-neutral"> </span>
|
|
397
468
|
<span class="cline-any cline-neutral"> </span>
|
|
398
469
|
<span class="cline-any cline-neutral"> </span>
|
|
470
|
+
<span class="cline-any cline-yes">17x</span>
|
|
471
|
+
<span class="cline-any cline-yes">8x</span>
|
|
472
|
+
<span class="cline-any cline-yes">1x</span>
|
|
473
|
+
<span class="cline-any cline-yes">1x</span>
|
|
474
|
+
<span class="cline-any cline-neutral"> </span>
|
|
475
|
+
<span class="cline-any cline-yes">7x</span>
|
|
476
|
+
<span class="cline-any cline-yes">5x</span>
|
|
477
|
+
<span class="cline-any cline-yes">5x</span>
|
|
478
|
+
<span class="cline-any cline-neutral"> </span>
|
|
479
|
+
<span class="cline-any cline-neutral"> </span>
|
|
480
|
+
<span class="cline-any cline-neutral"> </span>
|
|
481
|
+
<span class="cline-any cline-yes">11x</span>
|
|
482
|
+
<span class="cline-any cline-no"> </span>
|
|
399
483
|
<span class="cline-any cline-no"> </span>
|
|
400
484
|
<span class="cline-any cline-no"> </span>
|
|
485
|
+
<span class="cline-any cline-neutral"> </span>
|
|
401
486
|
<span class="cline-any cline-no"> </span>
|
|
402
487
|
<span class="cline-any cline-no"> </span>
|
|
403
488
|
<span class="cline-any cline-no"> </span>
|
|
404
489
|
<span class="cline-any cline-no"> </span>
|
|
405
490
|
<span class="cline-any cline-neutral"> </span>
|
|
406
491
|
<span class="cline-any cline-neutral"> </span>
|
|
492
|
+
<span class="cline-any cline-yes">11x</span>
|
|
493
|
+
<span class="cline-any cline-yes">9x</span>
|
|
494
|
+
<span class="cline-any cline-yes">9x</span>
|
|
495
|
+
<span class="cline-any cline-neutral"> </span>
|
|
496
|
+
<span class="cline-any cline-yes">9x</span>
|
|
407
497
|
<span class="cline-any cline-no"> </span>
|
|
498
|
+
<span class="cline-any cline-yes">9x</span>
|
|
408
499
|
<span class="cline-any cline-no"> </span>
|
|
409
|
-
<span class="cline-any cline-
|
|
410
|
-
<span class="cline-any cline-no"> </span>
|
|
500
|
+
<span class="cline-any cline-yes">9x</span>
|
|
411
501
|
<span class="cline-any cline-no"> </span>
|
|
412
502
|
<span class="cline-any cline-neutral"> </span>
|
|
413
503
|
<span class="cline-any cline-neutral"> </span>
|
|
414
504
|
<span class="cline-any cline-neutral"> </span>
|
|
415
505
|
<span class="cline-any cline-neutral"> </span>
|
|
416
|
-
<span class="cline-any cline-
|
|
417
|
-
<span class="cline-any cline-
|
|
506
|
+
<span class="cline-any cline-neutral"> </span>
|
|
507
|
+
<span class="cline-any cline-neutral"> </span>
|
|
508
|
+
<span class="cline-any cline-yes">84x</span>
|
|
509
|
+
<span class="cline-any cline-yes">30x</span>
|
|
418
510
|
<span class="cline-any cline-no"> </span>
|
|
419
511
|
<span class="cline-any cline-no"> </span>
|
|
420
512
|
<span class="cline-any cline-neutral"> </span>
|
|
421
513
|
<span class="cline-any cline-neutral"> </span>
|
|
422
|
-
<span class="cline-any cline-
|
|
514
|
+
<span class="cline-any cline-yes">30x</span>
|
|
423
515
|
<span class="cline-any cline-no"> </span>
|
|
424
516
|
<span class="cline-any cline-no"> </span>
|
|
425
517
|
<span class="cline-any cline-neutral"> </span>
|
|
426
518
|
<span class="cline-any cline-no"> </span>
|
|
427
519
|
<span class="cline-any cline-neutral"> </span>
|
|
428
520
|
<span class="cline-any cline-neutral"> </span>
|
|
429
|
-
<span class="cline-any cline-
|
|
430
|
-
<span class="cline-any cline-
|
|
431
|
-
<span class="cline-any cline-
|
|
521
|
+
<span class="cline-any cline-yes">30x</span>
|
|
522
|
+
<span class="cline-any cline-yes">22x</span>
|
|
523
|
+
<span class="cline-any cline-yes">22x</span>
|
|
432
524
|
<span class="cline-any cline-neutral"> </span>
|
|
433
525
|
<span class="cline-any cline-neutral"> </span>
|
|
434
|
-
<span class="cline-any cline-
|
|
526
|
+
<span class="cline-any cline-yes">8x</span>
|
|
435
527
|
<span class="cline-any cline-no"> </span>
|
|
436
528
|
<span class="cline-any cline-no"> </span>
|
|
437
529
|
<span class="cline-any cline-neutral"> </span>
|
|
438
530
|
<span class="cline-any cline-neutral"> </span>
|
|
439
|
-
<span class="cline-any cline-
|
|
440
|
-
<span class="cline-any cline-
|
|
441
|
-
<span class="cline-any cline-
|
|
531
|
+
<span class="cline-any cline-yes">8x</span>
|
|
532
|
+
<span class="cline-any cline-yes">8x</span>
|
|
533
|
+
<span class="cline-any cline-yes">8x</span>
|
|
534
|
+
<span class="cline-any cline-neutral"> </span>
|
|
535
|
+
<span class="cline-any cline-neutral"> </span>
|
|
536
|
+
<span class="cline-any cline-yes">84x</span>
|
|
442
537
|
<span class="cline-any cline-neutral"> </span>
|
|
443
538
|
<span class="cline-any cline-neutral"> </span>
|
|
444
|
-
<span class="cline-any cline-yes">24x</span>
|
|
445
539
|
<span class="cline-any cline-neutral"> </span>
|
|
446
540
|
<span class="cline-any cline-neutral"> </span>
|
|
447
541
|
<span class="cline-any cline-neutral"> </span>
|
|
@@ -463,20 +557,20 @@
|
|
|
463
557
|
<span class="cline-any cline-neutral"> </span>
|
|
464
558
|
<span class="cline-any cline-neutral"> </span>
|
|
465
559
|
<span class="cline-any cline-neutral"> </span>
|
|
466
|
-
<span class="cline-any cline-neutral"> </span></td><td class="text"><pre class="prettyprint lang-js">import React from
|
|
467
|
-
import { useInput } from
|
|
468
|
-
import { useContainerActions } from
|
|
469
|
-
import { useContainerCreation } from
|
|
470
|
-
import { useLogsViewer } from
|
|
471
|
-
import { useContainerSelection } from
|
|
472
|
-
import { useDebugLogs } from
|
|
473
|
-
import { useEraseConfirmation } from
|
|
474
|
-
import { useExitHandler } from
|
|
475
|
-
import { useContainerCommandRouter } from
|
|
476
|
-
import { getLogsStream } from
|
|
477
|
-
import { createContainer as svcCreateContainer } from
|
|
478
|
-
import { buildContainerOptions } from
|
|
479
|
-
import { DB_IMAGES } from
|
|
560
|
+
<span class="cline-any cline-neutral"> </span></td><td class="text"><pre class="prettyprint lang-js">import React from 'react';
|
|
561
|
+
import { useInput } from 'ink';
|
|
562
|
+
import { useContainerActions } from './creation/useContainerActions';
|
|
563
|
+
import { useContainerCreation } from './creation/useContainerCreation';
|
|
564
|
+
import { useLogsViewer } from './creation/useLogsViewer';
|
|
565
|
+
import { useContainerSelection } from './navigation/useContainerSelection';
|
|
566
|
+
import { useDebugLogs } from './debug/useDebugLogs';
|
|
567
|
+
import { useEraseConfirmation } from './useEraseConfirmation';
|
|
568
|
+
import { useExitHandler } from './useExitHandler';
|
|
569
|
+
import { useContainerCommandRouter } from './useContainerCommandRouter';
|
|
570
|
+
import { getLogsStream } from '../helpers/dockerService/serviceComponents/containerLogs.js';
|
|
571
|
+
import { createContainer as svcCreateContainer } from '../helpers/dockerService/serviceComponents/containerActions.js';
|
|
572
|
+
import { buildContainerOptions } from '../helpers/containerOptionsBuilder.js';
|
|
573
|
+
import { DB_IMAGES } from '../helpers/constants.js';
|
|
480
574
|
|
|
481
575
|
// Principal hook to manage user inputs and control the app state
|
|
482
576
|
/**
|
|
@@ -494,20 +588,29 @@ export function useControls(containers = <span class="branch-0 cbranch-no" title
|
|
|
494
588
|
|
|
495
589
|
const creation = useContainerCreation({
|
|
496
590
|
onCreate: async ({ imageName, containerName, portInput, envInput }) => {
|
|
497
|
-
const options = buildContainerOptions({
|
|
591
|
+
const options = buildContainerOptions({
|
|
592
|
+
imageName,
|
|
593
|
+
containerName,
|
|
594
|
+
portInput,
|
|
595
|
+
envInput,
|
|
596
|
+
});
|
|
498
597
|
actions.setMessage(`Creating container ${imageName}...`);
|
|
499
|
-
actions.setMessageColor(
|
|
598
|
+
actions.setMessageColor('yellow');
|
|
500
599
|
try {
|
|
501
600
|
const { id, ports } = await svcCreateContainer(imageName, options);
|
|
502
|
-
let portMsg =
|
|
601
|
+
let portMsg = '';
|
|
503
602
|
if (ports && ports.length) {
|
|
504
|
-
portMsg =
|
|
603
|
+
portMsg =
|
|
604
|
+
' | Ports: ' +
|
|
605
|
+
ports
|
|
606
|
+
.map((p) => `${p.hostPort}→${p.containerPort}/${p.protocol}`)
|
|
607
|
+
.join(', ');
|
|
505
608
|
}
|
|
506
609
|
actions.setMessage(`Created container ${id}${portMsg}`);
|
|
507
|
-
actions.setMessageColor(
|
|
610
|
+
actions.setMessageColor('green');
|
|
508
611
|
} catch (err) {
|
|
509
612
|
actions.setMessage(`Error creating container: ${err.message}`);
|
|
510
|
-
actions.setMessageColor(
|
|
613
|
+
actions.setMessageColor('red');
|
|
511
614
|
} finally {
|
|
512
615
|
setCreatingContainer(false);
|
|
513
616
|
}
|
|
@@ -524,14 +627,14 @@ export function useControls(containers = <span class="branch-0 cbranch-no" title
|
|
|
524
627
|
onConfirm: <span class="fstat-no" title="function not covered" >()</span> => {
|
|
525
628
|
<span class="cstat-no" title="statement not covered" > actions.handleAction({</span>
|
|
526
629
|
actionFn: <span class="fstat-no" title="function not covered" >as</span>ync (id) => <span class="cstat-no" title="statement not covered" >await actions.removeContainer(id),</span>
|
|
527
|
-
actionLabel:
|
|
630
|
+
actionLabel: 'Erasing',
|
|
528
631
|
selected: selection.selected,
|
|
529
632
|
});
|
|
530
|
-
<span class="cstat-no" title="statement not covered" > actions.setMessageColor(
|
|
633
|
+
<span class="cstat-no" title="statement not covered" > actions.setMessageColor('yellow');</span>
|
|
531
634
|
},
|
|
532
635
|
onCancel: <span class="fstat-no" title="function not covered" >()</span> => {
|
|
533
|
-
<span class="cstat-no" title="statement not covered" > actions.setMessage(
|
|
534
|
-
<span class="cstat-no" title="statement not covered" > actions.setMessageColor(
|
|
636
|
+
<span class="cstat-no" title="statement not covered" > actions.setMessage('');</span>
|
|
637
|
+
<span class="cstat-no" title="statement not covered" > actions.setMessageColor('');</span>
|
|
535
638
|
},
|
|
536
639
|
});
|
|
537
640
|
|
|
@@ -539,17 +642,22 @@ export function useControls(containers = <span class="branch-0 cbranch-no" title
|
|
|
539
642
|
* Pipe container logs into the viewer while applying a hard limit.
|
|
540
643
|
* @param {string} containerId - Container identifier used by Docker.
|
|
541
644
|
*/
|
|
542
|
-
const startLogsStream = React.useCallback(
|
|
543
|
-
<span class="
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
<span class="cstat-no" title="statement not covered" >
|
|
548
|
-
|
|
549
|
-
<span class="
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
645
|
+
const startLogsStream = React.useCallback(
|
|
646
|
+
<span class="fstat-no" title="function not covered" > (c</span>ontainerId) => {
|
|
647
|
+
<span class="cstat-no" title="statement not covered" > getLogsStream(</span>
|
|
648
|
+
containerId,
|
|
649
|
+
<span class="fstat-no" title="function not covered" > (d</span>ata) =>
|
|
650
|
+
<span class="cstat-no" title="statement not covered" > logsViewer.setLogs(<span class="fstat-no" title="function not covered" >(p</span>rev) => {</span>
|
|
651
|
+
const newLogs = <span class="cstat-no" title="statement not covered" >[...prev, ...data.split('\n').filter(Boolean)];</span>
|
|
652
|
+
<span class="cstat-no" title="statement not covered" > return newLogs.slice(-1000);</span>
|
|
653
|
+
}),
|
|
654
|
+
<span class="fstat-no" title="function not covered" > ()</span> => {},
|
|
655
|
+
<span class="fstat-no" title="function not covered" > (e</span>rr) =>
|
|
656
|
+
<span class="cstat-no" title="statement not covered" > logsViewer.setLogs(<span class="fstat-no" title="function not covered" >(p</span>rev) => <span class="cstat-no" title="statement not covered" >[...prev, `Error: ${err.message}`])</span></span>
|
|
657
|
+
);
|
|
658
|
+
},
|
|
659
|
+
[logsViewer]
|
|
660
|
+
);
|
|
553
661
|
|
|
554
662
|
const commandRouter = useContainerCommandRouter({
|
|
555
663
|
actions,
|
|
@@ -560,17 +668,19 @@ export function useControls(containers = <span class="branch-0 cbranch-no" title
|
|
|
560
668
|
startLogsStream,
|
|
561
669
|
onStartErase: <span class="fstat-no" title="function not covered" >()</span> => {
|
|
562
670
|
<span class="cstat-no" title="statement not covered" > eraseConfirmation.startErase();</span>
|
|
563
|
-
<span class="cstat-no" title="statement not covered" > actions.setMessage(
|
|
564
|
-
|
|
671
|
+
<span class="cstat-no" title="statement not covered" > actions.setMessage(</span>
|
|
672
|
+
'Are you sure you want to erase this container? (y/n)'
|
|
673
|
+
);
|
|
674
|
+
<span class="cstat-no" title="statement not covered" > actions.setMessageColor('yellow');</span>
|
|
565
675
|
},
|
|
566
676
|
onToggleDebug: <span class="fstat-no" title="function not covered" >()</span> => <span class="cstat-no" title="statement not covered" >debugLogs.setShowDebugLogs(<span class="fstat-no" title="function not covered" >(p</span>rev) => <span class="cstat-no" title="statement not covered" >!prev)</span>,</span>
|
|
567
|
-
onStartCreate:
|
|
677
|
+
onStartCreate: () => setCreatingContainer(true),
|
|
568
678
|
});
|
|
569
679
|
|
|
570
680
|
const exitHandler = useExitHandler({
|
|
571
681
|
onBeforeExit: <span class="fstat-no" title="function not covered" >()</span> => {
|
|
572
|
-
<span class="cstat-no" title="statement not covered" > actions.setMessage(
|
|
573
|
-
<span class="cstat-no" title="statement not covered" > actions.setMessageColor(
|
|
682
|
+
<span class="cstat-no" title="statement not covered" > actions.setMessage('Exiting...');</span>
|
|
683
|
+
<span class="cstat-no" title="statement not covered" > actions.setMessageColor('yellow');</span>
|
|
574
684
|
<span class="cstat-no" title="statement not covered" > logsViewer.closeLogs();</span>
|
|
575
685
|
<span class="cstat-no" title="statement not covered" > debugLogs.setShowDebugLogs(false);</span>
|
|
576
686
|
},
|
|
@@ -579,73 +689,104 @@ export function useControls(containers = <span class="branch-0 cbranch-no" title
|
|
|
579
689
|
/**
|
|
580
690
|
* Route keystrokes to the container creation wizard.
|
|
581
691
|
*/
|
|
582
|
-
const processCreationInput = React.useCallback(
|
|
583
|
-
|
|
692
|
+
const processCreationInput = React.useCallback(
|
|
693
|
+
(input, key) => {
|
|
694
|
+
const step = creation.step;
|
|
584
695
|
|
|
585
|
-
|
|
586
|
-
|
|
696
|
+
const removeLastChar = <span class="fstat-no" title="function not covered" >(s</span>etter) =>
|
|
697
|
+
<span class="cstat-no" title="statement not covered" > setter(<span class="fstat-no" title="function not covered" >(v</span>alue) => <span class="cstat-no" title="statement not covered" >(value || '').slice(0, -1))</span>;</span>
|
|
698
|
+
const appendChar = <span class="fstat-no" title="function not covered" >(s</span>etter, current, ch) => <span class="cstat-no" title="statement not covered" >setter((current || '') + ch);</span>
|
|
587
699
|
|
|
588
|
-
<span class="
|
|
589
|
-
<span class="cstat-no" title="statement not covered" >
|
|
590
|
-
<span class="cstat-no" title="statement not covered" >
|
|
591
|
-
<span class="cstat-no" title="statement not covered" >
|
|
592
|
-
|
|
700
|
+
<span class="missing-if-branch" title="if path not taken" >I</span>if (key.escape) {
|
|
701
|
+
<span class="cstat-no" title="statement not covered" > creation.cancelCreation();</span>
|
|
702
|
+
<span class="cstat-no" title="statement not covered" > setCreatingContainer(false);</span>
|
|
703
|
+
<span class="cstat-no" title="statement not covered" > return;</span>
|
|
704
|
+
}
|
|
593
705
|
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
706
|
+
if (input === '\r' || input === '\n') {
|
|
707
|
+
// If on step 0 with a focused suggestion, apply it instead of advancing
|
|
708
|
+
if (step === 0 && creation.selectedSuggestionIndex >= 0) {
|
|
709
|
+
creation.applyFocusedSuggestion();
|
|
710
|
+
return;
|
|
711
|
+
}
|
|
712
|
+
creation.nextStep();
|
|
713
|
+
return;
|
|
714
|
+
}
|
|
598
715
|
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
716
|
+
// Arrow keys on step 0: navigate suggestion list
|
|
717
|
+
if (step === 0 && creation.suggestions.length > 0) {
|
|
718
|
+
if (key.upArrow) {
|
|
719
|
+
creation.moveSuggestionSelection(-1);
|
|
720
|
+
return;
|
|
721
|
+
}
|
|
722
|
+
if (key.downArrow) {
|
|
723
|
+
creation.moveSuggestionSelection(1);
|
|
724
|
+
return;
|
|
725
|
+
}
|
|
726
|
+
}
|
|
606
727
|
|
|
607
|
-
<span class="
|
|
608
|
-
<span class="cstat-no" title="statement not covered" >
|
|
609
|
-
|
|
610
|
-
<span class="cstat-no" title="statement not covered" >
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
728
|
+
<span class="missing-if-branch" title="if path not taken" >I</span>if (key.backspace || key.delete) {
|
|
729
|
+
<span class="cstat-no" title="statement not covered" > if (step === 0) {</span>
|
|
730
|
+
const newValue = <span class="cstat-no" title="statement not covered" >(creation.imageName || '').slice(0, -1);</span>
|
|
731
|
+
<span class="cstat-no" title="statement not covered" > creation.updateImageInput(newValue);</span>
|
|
732
|
+
}
|
|
733
|
+
<span class="cstat-no" title="statement not covered" > if (step === 1) <span class="cstat-no" title="statement not covered" >removeLastChar(creation.setContainerName);</span></span>
|
|
734
|
+
<span class="cstat-no" title="statement not covered" > if (step === 2) <span class="cstat-no" title="statement not covered" >removeLastChar(creation.setPortInput);</span></span>
|
|
735
|
+
<span class="cstat-no" title="statement not covered" > if (step === 3) <span class="cstat-no" title="statement not covered" >removeLastChar(creation.setEnvInput);</span></span>
|
|
736
|
+
<span class="cstat-no" title="statement not covered" > return;</span>
|
|
737
|
+
}
|
|
738
|
+
|
|
739
|
+
if (input && input.length === 1 && !key.ctrl && !key.meta) {
|
|
740
|
+
<span class="missing-if-branch" title="else path not taken" >E</span>if (step === 0) {
|
|
741
|
+
creation.updateImageInput((creation.imageName || '') + input);
|
|
742
|
+
}
|
|
743
|
+
<span class="missing-if-branch" title="if path not taken" >I</span>if (step === 1)
|
|
744
|
+
<span class="cstat-no" title="statement not covered" > appendChar(creation.setContainerName, creation.containerName, input);</span>
|
|
745
|
+
<span class="missing-if-branch" title="if path not taken" >I</span>if (step === 2)
|
|
746
|
+
<span class="cstat-no" title="statement not covered" > appendChar(creation.setPortInput, creation.portInput, input);</span>
|
|
747
|
+
<span class="missing-if-branch" title="if path not taken" >I</span>if (step === 3)
|
|
748
|
+
<span class="cstat-no" title="statement not covered" > appendChar(creation.setEnvInput, creation.envInput, input);</span>
|
|
749
|
+
}
|
|
750
|
+
},
|
|
751
|
+
[creation, setCreatingContainer]
|
|
752
|
+
);
|
|
614
753
|
|
|
615
754
|
// Single keyboard entry point
|
|
616
|
-
useInput(
|
|
617
|
-
<span class="
|
|
755
|
+
useInput((input, key) => {
|
|
756
|
+
<span class="missing-if-branch" title="if path not taken" >I</span>if (eraseConfirmation.confirmErase) {
|
|
618
757
|
<span class="cstat-no" title="statement not covered" > eraseConfirmation.processEraseConfirmation(input, key);</span>
|
|
619
758
|
<span class="cstat-no" title="statement not covered" > return;</span>
|
|
620
759
|
}
|
|
621
760
|
|
|
622
|
-
<span class="
|
|
623
|
-
<span class="cstat-no" title="statement not covered" > if (input ===
|
|
761
|
+
<span class="missing-if-branch" title="if path not taken" >I</span>if (logsViewer.showLogs) {
|
|
762
|
+
<span class="cstat-no" title="statement not covered" > if (input === 'q' || key.escape) {</span>
|
|
624
763
|
<span class="cstat-no" title="statement not covered" > logsViewer.closeLogs();</span>
|
|
625
764
|
}
|
|
626
765
|
<span class="cstat-no" title="statement not covered" > return;</span>
|
|
627
766
|
}
|
|
628
767
|
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
768
|
+
if (creatingContainer) {
|
|
769
|
+
processCreationInput(input, key);
|
|
770
|
+
return;
|
|
632
771
|
}
|
|
633
772
|
|
|
634
|
-
<span class="
|
|
773
|
+
<span class="missing-if-branch" title="if path not taken" >I</span>if (debugLogs.showDebugLogs && <span class="branch-1 cbranch-no" title="branch not covered" >key.escape)</span> {
|
|
635
774
|
<span class="cstat-no" title="statement not covered" > debugLogs.setShowDebugLogs(false);</span>
|
|
636
775
|
<span class="cstat-no" title="statement not covered" > return;</span>
|
|
637
776
|
}
|
|
638
777
|
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
778
|
+
commandRouter.handleDockerCommands(input);
|
|
779
|
+
exitHandler.handleExitCommand(input);
|
|
780
|
+
selection.handleNavigation(input, key);
|
|
642
781
|
});
|
|
643
782
|
|
|
644
783
|
return {
|
|
645
784
|
selected: selection.selected,
|
|
646
785
|
setSelected: selection.setSelected,
|
|
647
|
-
message: creatingContainer ?
|
|
648
|
-
messageColor: creatingContainer
|
|
786
|
+
message: creatingContainer ? creation.message : actions.message,
|
|
787
|
+
messageColor: creatingContainer
|
|
788
|
+
? creation.messageColor
|
|
789
|
+
: actions.messageColor,
|
|
649
790
|
showLogs: logsViewer.showLogs,
|
|
650
791
|
logs: logsViewer.logs,
|
|
651
792
|
exitLogs: logsViewer.closeLogs,
|
|
@@ -670,7 +811,7 @@ export function useControls(containers = <span class="branch-0 cbranch-no" title
|
|
|
670
811
|
<div class='footer quiet pad2 space-top1 center small'>
|
|
671
812
|
Code coverage generated by
|
|
672
813
|
<a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
|
|
673
|
-
at 2026-04-
|
|
814
|
+
at 2026-04-27T20:17:25.625Z
|
|
674
815
|
</div>
|
|
675
816
|
<script src="../prettify.js"></script>
|
|
676
817
|
<script>
|