Skip to content

Commit 47378d7

Browse files
Merge pull request #7 from herdux/refactor/multi-engine-architecture
feat: implement multi-engine architecture and establish open source standards
2 parents e7fcdfd + 61c69d6 commit 47378d7

54 files changed

Lines changed: 3221 additions & 808 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
---
2+
name: Bug Report
3+
about: Create a report to help us improve Herdux.
4+
title: "[BUG] "
5+
labels: bug
6+
assignees: ""
7+
---
8+
9+
## 🐛 Bug Description
10+
11+
A clear and concise description of what the bug is. (e.g., When trying to backup MySQL while passing the --drop flag, Herdux crashes).
12+
13+
## 💻 How to Reproduce
14+
15+
Steps to reproduce the behavior:
16+
17+
1. `herdux config set engine mysql`
18+
2. `herdux backup db_test --drop`
19+
3. See error: ...
20+
21+
## 🩺 Herdux Doctor Output
22+
23+
Paste the result of running the doctor command (remove sensitive data if necessary):
24+
25+
```bash
26+
hdx doctor --engine [your_engine]
27+
# Your output here
28+
```
29+
30+
## 🌍 Your Environment
31+
32+
- **OS**: [e.g., Ubuntu 22.04 LTS, macOS Sonoma 14.1]
33+
- **Node Version**: [e.g., v20.10.0]
34+
- **Herdux Version**: (Run `hdx version`)
35+
- **Engine and Client Tool**: (e.g., PostgreSQL 16 local, MySQL 8 via Docker)
36+
37+
## 📸 Additional Screenshots / Logs
38+
39+
If applicable, add screenshots or full error logs (`--verbose` if available) from the terminal.
40+
41+
## 📝 Additional Context
42+
43+
Any other context (e.g., "I am running within a restricted terminal" or "The disk is 100% full").
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
---
2+
name: Feature Request
3+
about: Suggest an idea for the Herdux CLI.
4+
title: "[FEAT] "
5+
labels: enhancement
6+
assignees: ""
7+
---
8+
9+
## 🚀 What problem does this feature solve?
10+
11+
A clear and concise description of the problem. e.g., I always feel anxious when running `clean` and I would like to have a "dry run" mode.
12+
13+
## 💡 What is your ideal solution?
14+
15+
Explain how you imagine the new command or feature functioning.
16+
17+
Example:
18+
19+
```bash
20+
herdux clean --dry-run
21+
# Returns only a list of databases that would be affected without actually dropping them.
22+
```
23+
24+
## 🔄 Alternatives Considered
25+
26+
Are there other ways to work around this currently? Did you consider using a different flag?
27+
28+
## 📝 Additional Context
29+
30+
Add any other context or links to documentation here (e.g., links to tools like pg_dump documentation if the feature involves them).

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
## 📌 PR Description
2+
3+
Please provide a detailed description of what this Pull Request addresses. (e.g., "Adds preliminary support for the `--dry-run` flag to the `clean` command")
4+
5+
Is this a bug fix, a new feature, or a refactoring?
6+
7+
**Related issues:** Closes # (Issue Number), Resolves #
8+
9+
---
10+
11+
## 🏗️ How to Test
12+
13+
Please list the steps required to validate this change locally:
14+
15+
1. ...
16+
2. ...
17+
18+
---
19+
20+
## ✅ Quality Checklist
21+
22+
Before opening this PR, please check all that apply:
23+
24+
- [ ] My code follows the architecture and contribution guidelines (`CONTRIBUTING.md` and `AGENTS.md`).
25+
- [ ] The implemented command is _Engine Agnostic_ (database logic resides inside `src/infra/`).
26+
- [ ] I ran `npm run lint:fix` and my code uses the standard formatting.
27+
- [ ] I ran and passed all local Unit Tests for my engine.
28+
- [ ] I successfully ran the **End-to-End Tests** via Docker (e.g., `npm run test:e2e:pgsql` / `mysql`).
29+
- [ ] I updated the README or command instructions (if I added/modified flags or behavior).
30+
31+
---
32+
33+
## 📸 Screenshots (Optional)
34+
35+
If there are any visual changes involving prompts or menus, please attach before/after screenshots here.

.github/assets/logo.svg

Lines changed: 46 additions & 0 deletions
Loading

.github/dependabot.yml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
version: 2
2+
updates:
3+
- package-ecosystem: "npm"
4+
directory: "/"
5+
schedule:
6+
interval: "weekly"
7+
day: "monday"
8+
time: "09:00"
9+
timezone: "America/Sao_Paulo"
10+
open-pull-requests-limit: 10
11+
commit-message:
12+
prefix: "chore"
13+
include: "scope"
14+
- package-ecosystem: "github-actions"
15+
directory: "/"
16+
schedule:
17+
interval: "monthly"
18+
day: "monday"
19+
timezone: "America/Sao_Paulo"

.github/workflows/ci.yml

Lines changed: 106 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,106 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches: ["main"]
6+
pull_request:
7+
branches: ["main"]
8+
9+
jobs:
10+
lint-and-test:
11+
name: Lint & Unit Tests
12+
runs-on: ubuntu-latest
13+
14+
strategy:
15+
matrix:
16+
node-version: [18.x, 20.x, 22.x]
17+
18+
steps:
19+
- name: Checkout code
20+
uses: actions/checkout@v4
21+
22+
- name: Setup Node.js ${{ matrix.node-version }}
23+
uses: actions/setup-node@v4
24+
with:
25+
node-version: ${{ matrix.node-version }}
26+
cache: "npm"
27+
28+
- name: Install dependencies
29+
run: npm ci
30+
31+
- name: Check Formatting (Prettier)
32+
run: npm run lint:check
33+
34+
- name: Build
35+
run: npm run build
36+
37+
- name: Run Unit Tests
38+
run: npm run test:unit
39+
40+
e2e-postgres:
41+
name: E2E Tests (PostgreSQL)
42+
runs-on: ubuntu-latest
43+
needs: lint-and-test
44+
45+
steps:
46+
- name: Checkout code
47+
uses: actions/checkout@v4
48+
49+
- name: Setup Node.js 20.x
50+
uses: actions/setup-node@v4
51+
with:
52+
node-version: 20.x
53+
cache: "npm"
54+
55+
- name: Install dependencies & Build
56+
run: |
57+
npm ci
58+
npm run build
59+
npm link
60+
61+
- name: Install PostgreSQL Client Tools
62+
run: sudo apt-get update && sudo apt-get install -y postgresql-client
63+
64+
- name: Start PostgreSQL Database (Docker)
65+
run: npm run test:e2e:pgsql:up
66+
67+
- name: Run E2E Tests for PostgreSQL
68+
run: npm run test:e2e:pgsql
69+
70+
- name: Teardown Database
71+
if: always() # Garante que os containers morram mesmo se o teste falhar
72+
run: npm run test:e2e:pgsql:down
73+
74+
e2e-mysql:
75+
name: E2E Tests (MySQL)
76+
runs-on: ubuntu-latest
77+
needs: lint-and-test
78+
79+
steps:
80+
- name: Checkout code
81+
uses: actions/checkout@v4
82+
83+
- name: Setup Node.js 20.x
84+
uses: actions/setup-node@v4
85+
with:
86+
node-version: 20.x
87+
cache: "npm"
88+
89+
- name: Install dependencies & Build
90+
run: |
91+
npm ci
92+
npm run build
93+
npm link
94+
95+
- name: Install MySQL Client Tools
96+
run: sudo apt-get update && sudo apt-get install -y mysql-client
97+
98+
- name: Start MySQL Database (Docker)
99+
run: npm run test:e2e:mysql:up
100+
101+
- name: Run E2E Tests for MySQL
102+
run: npm run test:e2e:mysql
103+
104+
- name: Teardown Database
105+
if: always()
106+
run: npm run test:e2e:mysql:down

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,3 +38,4 @@ tests/e2e/postgres/.tmp-home/
3838
ROADMAP.md
3939
VISION.md
4040
tsc-errors.txt
41+
PROJECT_RESUME.md

.husky/pre-commit

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
npx lint-staged

0 commit comments

Comments
 (0)