Skip to content

Commit c85446d

Browse files
committed
modified: DEVELOPMENT.md
1 parent 768beb8 commit c85446d

File tree

1 file changed

+61
-29
lines changed

1 file changed

+61
-29
lines changed

DEVELOPMENT.md

Lines changed: 61 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1-
# Development Guide: configng-v2 Modules and Staging Workflow
1+
# Development Guide: armbian-config V3 (configng-v2)
2+
3+
## Modules and Staging Workflow
24

35
This guide outlines the module development and assembly process for **configng-v2**.
46
It defines the current approach, philosophy, and workflow for Bash-based modules, with practical steps for contributors and maintainers.
@@ -8,7 +10,7 @@ It defines the current approach, philosophy, and workflow for Bash-based modules
810
## 1. Philosophy: Bash-Native Modularity
911

1012
- **Modules are Bash scripts** designed to run independently (CLI/test/demo) or be sourced by the main framework (TUI/automation).
11-
- **Config files** (`.conf`) use simple, flat key=value pairs—like classic Linux `.conf` or `.ini` files.
13+
- **Config files** (`.conf`) use simple, flat key=value pairs.
1214
- **No forced Pythonic patterns:**
1315
- Avoid unnecessary functions or complex/nested.
1416
- Prefer simple, transparent Bash logic; use functions for clarity, not for forced structure.
@@ -21,49 +23,75 @@ It defines the current approach, philosophy, and workflow for Bash-based modules
2123
## 2. Directory & File Structure
2224

2325
- `staging/` — Where modules are created and refined before integration.
24-
- `src/` — Production modules (moved here after staging).
25-
- `testing/` — Manual and automated test scripts for modules.
26-
- `tools/` — Helper scripts for scaffolding, assembly, and automation.
26+
- `src/` — Production-ready source files (promoted from staging).
27+
- `tests/` — Manual and automated test scripts for both staged and promoted modules.
28+
- `lib/` — Consolidated, production-assembled Bash libraries (flattened from `src/`).
29+
- `tools/` — Scripts for scaffolding, promotion, consolidation, packaging, and workflow automation.
2730

2831
Each module consists of:
2932
- `modulename.sh` — The Bash implementation.
3033
- `modulename.conf` — Configuration and registration info (flat, Bash/INI style).
31-
- `[optional] modulename_test.sh` — Test script for the module.
34+
- `[optional] test_modulename.sh` — Test script for the module.
3235

3336
---
3437

35-
## 3. Staging & Module Workflow
38+
## 3. Module Workflow: From Staging to Package
39+
40+
Each module follows a strict flow from creation to packaging:
3641

3742
### Step 1: Scaffold
3843

39-
- Create a new module with:
40-
```sh
41-
./tools/staging_setup_scaffold.sh <modulename>
42-
```
43-
- This generates:
44-
- `staging/<modulename>.sh`
45-
- `staging/<modulename>.conf`
44+
Create a new module scaffold:
45+
46+
```sh
47+
./tools/staging_setup_scaffold.sh <modulename>
48+
```
49+
50+
This generates:
51+
- `staging/<modulename>.sh`
52+
- `staging/<modulename>.conf`
53+
- (Optional) `staging/<modulename>_test.sh`
4654

4755
### Step 2: Develop
4856

4957
- Implement logic in `.sh` with **tabs** for indentation.
50-
- Fill out all fields in `.conf` (see template below).
51-
- (Optional) Create associated test script in `staging/`.
58+
- Fill out all required fields in the `.conf` file.
59+
- Write a test `test_*.sh` script that targets the staging version.
60+
- (Optional) Extra info about module `doc_*.md`
61+
62+
### Step 3: Verify & Test
63+
64+
- GitHub actions Runs `shellcheck`, formatting checks, and required field validation.
65+
- run `tools/staging_01_check_required.sh` to varify files requierd are met
66+
- Execute test script(s) in `staging/` to confirm correctness and compatibility.
5267

53-
### Step 3: Submit
68+
##TODO
5469

55-
- Commit and push both `.sh` and `.conf` (and test, if present) to the staging area.
56-
- Pull request triggers CI/workflow checks:
57-
- Confirms all required files are present and `.conf` is valid.
70+
### Step 4: Promote
5871

59-
### Step 4: Integration
72+
- Move module components to their target locations as defined in `.conf`:
73+
- `.sh` → `src/<parent>/`
74+
- `.conf` → `src/<parent>/`
75+
- `.sh` test → `testing/`
76+
- This step makes the module part of the main tree and signals it's ready for assembly.
6077

61-
- On successful checks:
62-
- The `.conf` file is parsed for placement and registration (e.g., `placement=src/software/`).
63-
- Module code and test scripts are moved to their respective directories.
64-
- Central arrays/configs are updated for module discovery.
78+
### Step 5: Consolidate
6579

66-
**Do not bypass this process or repurpose staging for other tasks—this ensures robust, repeatable integration.**
80+
- Flatten all `src/<parent>/*.sh` into a single `lib/<parent>.sh`.
81+
- This creates production-grade output files used by the main framework.
82+
83+
### Step 6: Production Test
84+
85+
- Run full framework tests using the consolidated scripts in `lib/`.
86+
- This ensures compatibility and functionality in their final state.
87+
88+
### Step 7: Package
89+
90+
- If production-test passes, package the tool (e.g., `.deb`) using the build system.
91+
- Output is stored in `build/` or `dist/`.
92+
93+
**No steps should be skipped.
94+
The workflow enforces modular clarity, testability, and maintainability.**
6795

6896
---
6997

@@ -103,24 +131,28 @@ test_file=example_test.sh
103131

104132
## 6. FAQ & Rationale
105133

134+
106135
**Q: Why `.conf` and not `.meta` or `.json`?**
107136
A: `.conf` is universally editable, Bash-native, and works with Linux tooling. No extra parsing or editor config needed.
108137

109138
**Q: Can I use arrays or complex data?**
110139
A: Stick to simple, flat config for maximum portability and ease of parsing in Bash.
111140

112141
**Q: Must every module be a function library?**
113-
A: No—modules should be as simple as possible. Use functions where helpful, but modules must be independently runnable.
142+
A: Bash doesn’t have “real” functions like other programming languages. In Bash, so-called functions are just named blocks of code:
114143

115144
**Q: Why not a central controller?**
116145
A: Independence makes modules more robust, easier to test, and more flexible for CLI, TUI, or automation.
117146

147+
**Q: Are Bash functions meant for functional programming?**
148+
**A:** No. They're meant for code structure and reuse—not abstraction or composition.
149+
118150
---
119151

120152
## 7. Path Forward
121153

122154
- **Keep the workflow strict:**
123-
Staging, check, integration—no shortcuts.
155+
Staging, promote, consolidate, production-test, package—no shortcuts.
124156
- **Keep modules independent:**
125157
Each must be testable and callable alone.
126158
- **Keep configs simple:**
@@ -130,4 +162,4 @@ A: Independence makes modules more robust, easier to test, and more flexible for
130162

131163
---
132164

133-
*Stick to these principles for a maintainable, robust, and Bash-appropriate modular system.*
165+
*Stick to these principles for a maintainable, robust, and Bash-appropriate modular system.*

0 commit comments

Comments
 (0)