cdd-cli 3.2.2 → 4.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.
Files changed (126) hide show
  1. package/README.es.md +222 -0
  2. package/README.md +108 -26
  3. package/dist/App.js +7 -1
  4. package/dist/components/ContainerCreationPrompt.js +26 -10
  5. package/dist/components/ControlsHUD.js +106 -0
  6. package/dist/components/SuggestionPanel.js +16 -7
  7. package/dist/components/UsageMenu.js +1 -1
  8. package/dist/helpers/appState.js +26 -0
  9. package/dist/helpers/constants.js +60 -21
  10. package/dist/helpers/dockerHubService.js +111 -0
  11. package/dist/helpers/dockerService/serviceComponents/containerExec.js +211 -0
  12. package/dist/helpers/logger.js +1 -1
  13. package/dist/hooks/creation/useContainerActions.js +22 -5
  14. package/dist/hooks/creation/useContainerCreation.js +414 -107
  15. package/dist/hooks/useContainerCommandRouter.js +13 -3
  16. package/dist/hooks/useControls.js +28 -7
  17. package/dist/hooks/useShellMode.js +101 -0
  18. package/dist/index.js +10 -1
  19. package/package.json +4 -1
  20. package/.atl/skill-registry.md +0 -30
  21. package/.editorconfig +0 -12
  22. package/.eslintrc.json +0 -30
  23. package/.github/ISSUE_TEMPLATE/bug_report.md +0 -30
  24. package/.github/ISSUE_TEMPLATE/feature_request.md +0 -19
  25. package/.github/PULL_REQUEST_TEMPLATE/pull_request.md +0 -14
  26. package/.github/workflows/ci.yml +0 -32
  27. package/.github/workflows/docs.yml +0 -42
  28. package/.prettierignore +0 -4
  29. package/.prettierrc +0 -8
  30. package/CHANGELOG.md +0 -165
  31. package/CODE_OF_CONDUCT.md +0 -12
  32. package/CONTRIBUTING.md +0 -35
  33. package/SECURITY.md +0 -5
  34. package/__mocks__/ink.cjs +0 -17
  35. package/_config.yml +0 -13
  36. package/babel.config.cjs +0 -23
  37. package/coverage/clover.xml +0 -694
  38. package/coverage/coverage-final.json +0 -21
  39. package/coverage/lcov-report/base.css +0 -224
  40. package/coverage/lcov-report/block-navigation.js +0 -87
  41. package/coverage/lcov-report/components/ContainerCreationPrompt.jsx.html +0 -376
  42. package/coverage/lcov-report/components/PromptField.jsx.html +0 -229
  43. package/coverage/lcov-report/components/SuggestionPanel.jsx.html +0 -244
  44. package/coverage/lcov-report/components/index.html +0 -146
  45. package/coverage/lcov-report/favicon.png +0 -0
  46. package/coverage/lcov-report/helpers/constants.js.html +0 -298
  47. package/coverage/lcov-report/helpers/containerOptionsBuilder.js.html +0 -244
  48. package/coverage/lcov-report/helpers/dockerService/serviceComponents/containerActions.js.html +0 -931
  49. package/coverage/lcov-report/helpers/dockerService/serviceComponents/containerList.js.html +0 -307
  50. package/coverage/lcov-report/helpers/dockerService/serviceComponents/index.html +0 -131
  51. package/coverage/lcov-report/helpers/imageNameUtils.js.html +0 -181
  52. package/coverage/lcov-report/helpers/index.html +0 -191
  53. package/coverage/lcov-report/helpers/logger.js.html +0 -424
  54. package/coverage/lcov-report/helpers/safeCall.js.html +0 -139
  55. package/coverage/lcov-report/helpers/validationHelpers.js.html +0 -346
  56. package/coverage/lcov-report/hooks/creation/index.html +0 -146
  57. package/coverage/lcov-report/hooks/creation/useContainerActions.js.html +0 -313
  58. package/coverage/lcov-report/hooks/creation/useContainerCreation.js.html +0 -805
  59. package/coverage/lcov-report/hooks/creation/useLogsViewer.js.html +0 -238
  60. package/coverage/lcov-report/hooks/debug/index.html +0 -116
  61. package/coverage/lcov-report/hooks/debug/useDebugLogs.js.html +0 -187
  62. package/coverage/lcov-report/hooks/index.html +0 -161
  63. package/coverage/lcov-report/hooks/navigation/index.html +0 -116
  64. package/coverage/lcov-report/hooks/navigation/useContainerSelection.js.html +0 -169
  65. package/coverage/lcov-report/hooks/useContainerCommandRouter.js.html +0 -454
  66. package/coverage/lcov-report/hooks/useControls.js.html +0 -826
  67. package/coverage/lcov-report/hooks/useEraseConfirmation.js.html +0 -202
  68. package/coverage/lcov-report/hooks/useExitHandler.js.html +0 -292
  69. package/coverage/lcov-report/index.html +0 -206
  70. package/coverage/lcov-report/prettify.css +0 -1
  71. package/coverage/lcov-report/prettify.js +0 -2
  72. package/coverage/lcov-report/sort-arrow-sprite.png +0 -0
  73. package/coverage/lcov-report/sorter.js +0 -210
  74. package/coverage/lcov.info +0 -1402
  75. package/fix-imports.cjs +0 -54
  76. package/jest.config.cjs +0 -14
  77. package/src/App.jsx +0 -96
  78. package/src/components/ContainerCreationPrompt.jsx +0 -97
  79. package/src/components/ContainerList.jsx +0 -32
  80. package/src/components/ContainerRow.jsx +0 -84
  81. package/src/components/ContainerSection.jsx +0 -24
  82. package/src/components/Footer.jsx +0 -15
  83. package/src/components/Header.jsx +0 -41
  84. package/src/components/LogViewer.jsx +0 -36
  85. package/src/components/MessageFeedback.jsx +0 -25
  86. package/src/components/PromptField.jsx +0 -48
  87. package/src/components/StatsBar.jsx +0 -70
  88. package/src/components/SuggestionPanel.jsx +0 -53
  89. package/src/components/UsageMenu.jsx +0 -52
  90. package/src/helpers/appInfo.js +0 -23
  91. package/src/helpers/constants.js +0 -71
  92. package/src/helpers/containerOptionsBuilder.js +0 -53
  93. package/src/helpers/dockerService/dockerService.js +0 -28
  94. package/src/helpers/dockerService/serviceComponents/containerActions.js +0 -282
  95. package/src/helpers/dockerService/serviceComponents/containerList.js +0 -74
  96. package/src/helpers/dockerService/serviceComponents/containerLogs.js +0 -60
  97. package/src/helpers/dockerService/serviceComponents/containerStats.js +0 -69
  98. package/src/helpers/dockerService/serviceComponents/imageUtils.js +0 -32
  99. package/src/helpers/exitWithMessage.js +0 -32
  100. package/src/helpers/imageNameUtils.js +0 -32
  101. package/src/helpers/logger.js +0 -113
  102. package/src/helpers/safeCall.js +0 -18
  103. package/src/helpers/validationHelpers.js +0 -87
  104. package/src/hooks/creation/useContainerActions.js +0 -76
  105. package/src/hooks/creation/useContainerCreation.js +0 -240
  106. package/src/hooks/creation/useLogsViewer.js +0 -51
  107. package/src/hooks/debug/useDebugLogs.js +0 -34
  108. package/src/hooks/navigation/useContainerSelection.js +0 -28
  109. package/src/hooks/useContainerCommandRouter.js +0 -123
  110. package/src/hooks/useContainerStats.js +0 -44
  111. package/src/hooks/useContainers.js +0 -26
  112. package/src/hooks/useControls.js +0 -247
  113. package/src/hooks/useEraseConfirmation.js +0 -39
  114. package/src/hooks/useExitHandler.js +0 -69
  115. package/src/index.js +0 -16
  116. package/test/ContainerCreationPrompt.dom.test.js +0 -68
  117. package/test/SuggestionPanel.dom.test.js +0 -53
  118. package/test/constants.test.js +0 -34
  119. package/test/containerActions.test.js +0 -229
  120. package/test/containerList.test.js +0 -79
  121. package/test/containerOptionsBuilder.test.js +0 -36
  122. package/test/jest.setup.js +0 -7
  123. package/test/safeCall.test.js +0 -25
  124. package/test/useContainerCreation.dom.test.js +0 -264
  125. package/test/useControls.dom.test.js +0 -313
  126. package/test/validationHelpers.test.js +0 -111
package/CHANGELOG.md DELETED
@@ -1,165 +0,0 @@
1
- # Changelog
2
-
3
- All notable changes to this project will be documented in this file.
4
-
5
- Format follows [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
6
-
7
- ## [Unreleased]
8
- - Nothing yet.
9
-
10
- ## [3.2.2] - 2026-04-27
11
-
12
- ### Added
13
-
14
- - Interactive suggestion panel in container creation wizard (step 0) — shows filtered image suggestions below the input as the user types, navigable with ↑↓ and selectable with Enter
15
- - `IMAGE_PROFILES` expanded from 6 to 20 curated images (nginx, node, python, postgres, mysql, mongo, redis, kafka, elasticsearch, minio, wordpress, and more) each with `requiredEnv`, `defaultPort`, and `suggestedEnv`
16
- - `SuggestionPanel` component (`src/components/SuggestionPanel.jsx`) — offline, non-overlay panel with scrollable window and focused-row highlight
17
- - Contextual env var hints in step 3 — when a known image is selected, suggested variables (e.g. `POSTGRES_USER`, `POSTGRES_DB`) are shown as guidance
18
- - `updateImageInput()`, `moveSuggestionSelection()`, `applyFocusedSuggestion()` functions in `useContainerCreation` hook for autocomplete state management
19
- - Ink mock infrastructure (`__mocks__/ink.cjs`) with `triggerInput` helper for reliable keyboard routing tests
20
-
21
- ### Changed
22
-
23
- - `useControls.js` keyboard routing — ↑↓ and Enter are conditionally intercepted for suggestion navigation only on step 0 when suggestions are visible; all other steps preserve existing behavior
24
- - `ContainerCreationPrompt.jsx` — renders `SuggestionPanel` below the image input field on step 0
25
-
26
- ## [3.2.1] - 2026-04-27
27
-
28
- ### Changed
29
-
30
- - Unified `normalizeImageName` into a single `src/helpers/imageNameUtils.js` module; removed duplicate definitions from `validationHelpers.js` and `containerActions.js`.
31
- - Added Prettier and EditorConfig for automatic code formatting enforcement; 37 source files reformatted to consistent style (single quotes, 2-space indent, trailing commas ES5).
32
- - Added `eslint-config-prettier` to disable ESLint rules that conflict with Prettier.
33
- - Added `format` and `format:check` npm scripts.
34
-
35
- ### Fixed
36
-
37
- - Missing `.jsx` extension on `import App from './App'` in `src/index.js` (ESM correctness).
38
-
39
- ## [3.2.0] - 2026-04-25
40
-
41
- ### Added
42
-
43
- - `IMAGE_PROFILES` map in `src/helpers/constants.js` — defines `requiredEnv` and `defaultPort` per image type (mysql, mariadb, postgres, mongo, mssql, redis).
44
- - `DB_IMAGES` constant exported from `src/helpers/constants.js`.
45
- - Contextual validation in wizard: if image matches a known profile, required env vars are enforced before creation.
46
- - Auto-assigned port feedback: after successful container creation, the success message shows which ports were mapped (e.g. `Ports: 3306→3306/tcp`).
47
- - Image name normalization: tags and registry prefixes are stripped before profile lookup (`mysql:8`, `docker.io/library/postgres:16` → `mysql`, `postgres`).
48
- - New test files: `test/containerOptionsBuilder.test.js`, `test/useControls.dom.test.js`.
49
-
50
- ### Fixed
51
-
52
- - `validateEnvVars()` was never called in the container creation wizard step 3 — now connected and blocks on invalid input.
53
- - Env var parsing split on all `=` characters — fixed to split only on the first `=`, preserving values like `JWT=abc=def`.
54
- - `dbImages` was hardcoded in `useControls.js` — now imports `DB_IMAGES` from constants.
55
-
56
- ## [3.1.9] - 2026-04-11
57
-
58
- ### Changed
59
-
60
- - CI: added lint step to the test-and-build job; docs deploy now waits for CI to pass successfully via `workflow_run` trigger.
61
-
62
- ## [3.1.8] - 2026-04-11
63
-
64
- ### Refactored
65
-
66
- - Removed dead code: `actionHelpers`, `useLogsStream`, and esbuild-related artifacts that were no longer in use.
67
- - Consolidated Babel configuration into a single env-aware file, eliminating duplicate/split config files.
68
- - Decomposed `useControls` god hook into focused single-responsibility hooks, each owning one concern.
69
- - Extracted `useContainerStats` hook from `ContainerRow` to separate data-fetching from rendering.
70
- - Set Jest default environment to `node`; `jsdom` is now opt-in per test file, reducing unnecessary DOM overhead.
71
-
72
- ### Changed
73
-
74
- - Removed generated JSDoc output from the repository; added the generated docs directory to `.gitignore`.
75
- - Enabled `react/prop-types` ESLint rule project-wide and resolved all resulting warnings.
76
- - Rewrote `README.md` and `CONTRIBUTING.md`: consolidated overlapping content, removed duplication, and updated both for accuracy.
77
- - Various `docs(style)` and `docs` commits between v3.1.5 and the refactor wave: dark theme, sticky nav, landing page rewrite, CSS consolidation, and English translation for the JSDoc home (GitHub Pages site).
78
-
79
- ## [3.1.5] - 2025-10-18
80
- _Note: I'm sorry about the issues you've run into; this is a brand-new app and I'm still learning, but I'm moving as quickly as I can to deliver a quality experience._
81
-
82
- ### Added
83
-
84
- - `safeCall` utility to safely invoke optional callbacks and avoid uncaught errors from consumer callbacks.
85
- - PropTypes added to core React components for runtime prop validation (ContainerRow, ContainerList, LogViewer, StatsBar, ContainerCreationPrompt, PromptField, MessageFeedback, Header, ContainerSection).
86
-
87
- ### Changed
88
-
89
- - Container creation now inspects image `EXPOSE` declarations and auto-binds ports when the user leaves the ports step empty, reusing the next free host port to avoid conflicts (e.g. second `nginx` gets `81:80`).
90
- - CLI clears the terminal when starting and again after exiting with `q` for a cleaner shell experience.
91
- - Replaced direct optional callback invocations and stream destruction calls with `safeCall` in several modules (`containerLogs`, `useLogsStream`, `useLogsViewer`, `useContainerCreation`, `useContainerActions`, `LogViewer`).
92
- - ESLint config updated to include `jest` env and allow keeping `import React` for build compatibility.
93
- - Extracted common magic numbers into `src/helpers/constants.js` and replaced hardcoded values across the codebase:
94
- - `REFRESH_INTERVALS.CONTAINER_LIST` (3000)
95
- - `REFRESH_INTERVALS.CONTAINER_STATS` (1500)
96
- - `MESSAGE_TIMEOUTS.SHORT` (2000) and `MESSAGE_TIMEOUTS.DEFAULT` (3000)
97
- - `EXIT_DELAY` (500)
98
- - `TIMEOUTS.CONTAINER_OP` (30000) and `TIMEOUTS.PULL_IMAGE` (300000)
99
- - Files updated to use constants: `useContainers`, `ContainerRow`, `actionHelpers`, `useControls`, `exitWithMessage`, `containerActions`.
100
-
101
- ### Fixed
102
-
103
- - Added unit tests for `safeCall` and adjusted several components to silence lint warnings (unused variables).
104
- - Clamp `StatsBar` CPU/memory percentages to avoid negative repeat errors when streaming container stats (also refreshed component JSDoc to note the clamping).
105
-
106
- ### Testing
107
-
108
- - Added additional unit tests for Docker service functions and hooks. All tests pass locally (5 suites, 26 tests).
109
- - Removed generated `dist/` artifacts and deleted obsolete test files that referenced incompatible test helpers.
110
-
111
- Incoming fixes and smaller tests / docs updates
112
-
113
- ## [3.1.4] - 2025-10-17
114
-
115
- ### Changed
116
-
117
- - Documentation cleanup: translate `FIXES_APPLIED.md` to English, remove Spanish duplicate and references to internal audit doc.
118
- - No functional code changes.
119
-
120
- ## [3.1.3] - 2025-10-17
121
-
122
- ### Fixed
123
-
124
- - Addressed critical security and stability issues identified in internal audit.
125
- - Improved Docker service components robustness (`containerActions`, `containerList`, `containerLogs`, `containerStats`).
126
- - Strengthened validation helpers and extended unit tests.
127
-
128
- ### Added
129
-
130
- - Documentation: `FIXES_APPLIED.md` summarizing analysis and mitigations.
131
-
132
- ### Changed
133
-
134
- - Minor code refactors and clarifications across components and hooks.
135
-
136
- ## [3.1.2] - 2025-10-16
137
-
138
- ### Changed
139
-
140
- - Docs cleanup: remove Spanish inline comments; add English JSDoc across source files.
141
-
142
- ## [3.1.0] - 2025-10-16
143
-
144
- ### Added
145
-
146
- - Modularized hooks: `useContainerCreation`, `useContainerActions`, `useLogsViewer`.
147
- - Validation helpers and unit tests for port validation.
148
- - CI workflow (GitHub Actions) and README improvements.
149
-
150
- ### Changed
151
-
152
- - Container creation UX: English feedback messages, mandatory/validated port input, DB image warnings.
153
- - Added erase action (key `E`) with confirmation to delete containers.
154
- - Normalized source imports to include explicit `.js`/`.jsx` extensions for ESM compatibility.
155
-
156
- ### Fixed
157
-
158
- - Various runtime & build issues after modularization (import fixes, exposing container action functions, creation flow wiring).
159
-
160
- ## [3.1.1] - 2025-10-16
161
-
162
- ### Fixed
163
-
164
- - Minor docs typo fixes and README global install note added.
165
-
@@ -1,12 +0,0 @@
1
- # Contributor Covenant Code of Conduct
2
-
3
- This project follows the Contributor Covenant Code of Conduct. By participating, you agree to abide by its terms.
4
-
5
- Please see https://www.contributor-covenant.org/ for the full text.
6
- ## Code of Conduct
7
-
8
- This project follows the [Contributor Covenant](https://www.contributor-covenant.org/).
9
-
10
- Be respectful, inclusive, and kind. Harassment, discrimination, or abusive language will not be tolerated.
11
-
12
- If you experience or witness unacceptable behavior, please contact the maintainers.
package/CONTRIBUTING.md DELETED
@@ -1,35 +0,0 @@
1
- # Contributing to CDD-CLI
2
-
3
- Thanks for your interest in contributing! Here are the guidelines to make collaboration smooth.
4
-
5
- ## Getting started
6
-
7
- 1. Fork the repo and create a branch for your feature or fix:
8
-
9
- ```bash
10
- git checkout -b feat/my-feature
11
- ```
12
-
13
- 2. Install dependencies and verify everything works before making changes:
14
-
15
- ```bash
16
- npm install
17
- npm test
18
- npm run build
19
- ```
20
-
21
- ## Guidelines
22
-
23
- - Keep changes small and focused — one concern per PR.
24
- - Write tests for any new behavior and ensure existing tests pass (`npm test`).
25
- - Run `npm run build` and verify the CLI starts (`node dist/index.js`) before opening a PR.
26
- - Use [Conventional Commits](https://www.conventionalcommits.org/) for commit messages.
27
- - For large or design-changing contributions, open an issue first to discuss the approach.
28
-
29
- ## Opening a Pull Request
30
-
31
- - Describe the motivation and what changed.
32
- - Link any related issues.
33
- - Tag reviewers if applicable.
34
-
35
- We appreciate clear, well-tested contributions.
package/SECURITY.md DELETED
@@ -1,5 +0,0 @@
1
- # Security
2
-
3
- If you discover a security vulnerability, please report it privately to the repository owner.
4
-
5
- Do not disclose vulnerabilities publicly until they are resolved.
package/__mocks__/ink.cjs DELETED
@@ -1,17 +0,0 @@
1
- const React = require('react');
2
- exports.Box = ({ children, ...props }) =>
3
- React.createElement('div', { ...props }, children);
4
- exports.Text = ({ children, color }) =>
5
- React.createElement('span', { 'data-color': color }, children);
6
-
7
- // Capture the last registered useInput handler so tests can simulate keypresses.
8
- let _inputHandler = null;
9
- exports.useInput = (fn) => { _inputHandler = fn; };
10
- /** Simulate a keypress through the last registered useInput handler. */
11
- exports.__triggerInput = (input, key = {}) => {
12
- if (_inputHandler) _inputHandler(input, key);
13
- };
14
- /** Reset captured handler between tests. */
15
- exports.__resetInput = () => { _inputHandler = null; };
16
-
17
- exports.useApp = () => ({ exit: () => {} });
package/_config.yml DELETED
@@ -1,13 +0,0 @@
1
- # Configure GitHub Pages to treat the generated docs as a static site.
2
- source: docs
3
- # Disable the default theme so Jekyll does not expect its SCSS assets.
4
- theme: null
5
-
6
- # Allow Jekyll to copy across these asset folders untouched.
7
- include:
8
- - fonts
9
- - scripts
10
- - styles
11
-
12
- # We do not rely on any Jekyll plugins for this site.
13
- plugins: []
package/babel.config.cjs DELETED
@@ -1,23 +0,0 @@
1
- module.exports = {
2
- env: {
3
- test: {
4
- // Jest necesita CJS (transpila módulos) + React
5
- presets: [
6
- ['@babel/preset-env', { targets: { node: 'current' } }],
7
- '@babel/preset-react'
8
- ]
9
- },
10
- // build (NODE_ENV != 'test') → mantiene ESM para el output final
11
- production: {
12
- presets: [
13
- ['@babel/preset-env', { modules: false }],
14
- '@babel/preset-react'
15
- ]
16
- }
17
- },
18
- // Fallback para cualquier otro entorno (desarrollo local, etc.)
19
- presets: [
20
- ['@babel/preset-env', { modules: false }],
21
- '@babel/preset-react'
22
- ]
23
- };