Skip to content

Commit 20dbd56

Browse files
feat(monodog): merge pull request #15 from mindfiredigital/installable-package
feat(monodog): Updated project structure, improve security, added swagger and morgan, code cleanup
2 parents d3cf05f + 105fa57 commit 20dbd56

File tree

225 files changed

+8639
-8183
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

225 files changed

+8639
-8183
lines changed

.github/ISSUE_TEMPLATE/config.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@ blank_issues_enabled: true
22
contact_links:
33
- name: MonoDog
44
url: https://mindfiredigital.github.io/MonoDog/
5-
about: MonoDog is a dashboard provides visual management and monitoring for packages in monorepos using pnpm, Turborepo, and Nx, with automated CI/CD integration, semantic versioning, and development workflow optimization.
5+
about: MonoDog is a dashboard provides visual management and monitoring for packages in monorepos using pnpm with automated CI/CD integration, semantic versioning, and development workflow optimization.

.github/changeset-autogenerate.mjs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ let packageScope = null;
2121
let changeType = null;
2222
let description = null;
2323

24-
// 1. Check for Major Change using the "!" subject indicator
24+
// Check for Major Change using the "!" subject indicator
2525
if (commitPatterns.major.test(commitMessage)) {
2626
const scope = commitMessage.match(commitPatterns.major)?.[2];
2727
if (validScopes.includes(scope)) {
@@ -63,9 +63,9 @@ if (packageScope) {
6363

6464
// Write to a changeset file
6565
fs.writeFileSync(`.changeset/auto-${Date.now()}.md`, changesetContent);
66-
console.log(`Changeset file created for package: ${packageName}`);
66+
console.log(`Changeset file created for package: ${packageName}`);
6767
} else {
6868
console.log(
69-
'⚠️ No valid package scope found in commit message. Valid scopes are: monodog'
69+
'No valid package scope found in commit message. Valid scopes are: monodog'
7070
);
7171
}

documentation/docs/api-reference/config.md

Lines changed: 31 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ GET /api/config/files
1414
```
1515

1616
Returns all configuration files found in the monorepo (tsconfig, eslintrc, etc.).
17+
1718
Response:
1819
```json
1920
{
@@ -44,4 +45,33 @@ Response:
4445
...
4546
]
4647
}
47-
```
48+
```
49+
50+
## Update Configuration File
51+
52+
```bash
53+
PUT /api/config/files/ID
54+
```
55+
ID is the path of configuration file.
56+
57+
Update content of the configuration file.
58+
59+
Response:
60+
```json
61+
{
62+
"success": true,
63+
"file":
64+
{
65+
"id": "/packages/packageB/tsconfig.json",
66+
"name": "tsconfig.json",
67+
"path": "/packages/packageB/tsconfig.json",
68+
"type": "json",
69+
"content": "{\n \"files\": [],\n \"references\": [\n { \"path\": \"./tsconfig.app.json\" },\n { \"path\": \"./tsconfig.node.json\" }\n ]\n}\n",
70+
"size": 119,
71+
"lastModified": "2020-12-05T08:59:38.762Z",
72+
"hasSecrets": false,
73+
"isEditable": true
74+
},
75+
"message": "File saved successfully"
76+
}
77+
```

documentation/docs/api-reference/overview.md

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -3,37 +3,37 @@ sidebar_position: 1
33
title: API Overview
44
---
55

6-
# API Reference Overview
6+
# API Reference Overview
77

8-
Monodog has a complete REST API that lets developers access all monorepo data using the HTTP protocol.
8+
Monodog has a complete REST API that lets developers access all monorepo data using the HTTP protocol.
99

10-
## Base URL
10+
## Base URL
1111

1212
```
1313
http://localhost:8999/api
14-
```
15-
16-
## Endpoints
14+
```
1715

18-
### Packages
19-
- `GET /packages` - List all packages
20-
- `GET /packages/{name}` - Get package details
21-
- `GET /packages/refresh` - Refresh package data
16+
## Endpoints
2217

23-
### Health
24-
- `GET /health/packages` - Get health metrics for all packages
25-
- `POST /health/refresh` - Refresh health data
18+
### Packages
19+
- `GET /packages` - List all packages
20+
- `GET /packages/{NAME}` - Get package details
21+
- `POST /packages/refresh` - Refresh package data
2622

27-
### Commits
28-
- `GET /commits/{packagePath}` - Get commit history
23+
### Health
24+
- `GET /health/packages` - Get health metrics for all packages
25+
- `POST /health/refresh` - Refresh health data
2926

30-
### Config
31-
- `GET /config/files` - Get configuration files
27+
### Commits
28+
- `GET /commits/{PACKAGE_PATH}` - Get commit history
3229

30+
### Config
31+
- `GET /config/files` - Get configuration files
32+
- `PUT /config/files/{ID}` - Get configuration files
3333

34-
## Next Steps
34+
## Next Steps
3535

36-
- [Packages Endpoint](/api-reference/packages)
37-
- [Health Endpoint](/api-reference/health)
38-
- [Commits Endpoint](/api-reference/commits)
39-
- [Config Endpoint](/api-reference/config)
36+
- [Packages Endpoint](/api-reference/packages)
37+
- [Health Endpoint](/api-reference/health)
38+
- [Commits Endpoint](/api-reference/commits)
39+
- [Config Endpoint](/api-reference/config)

documentation/docs/api-reference/packages.md

Lines changed: 54 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ Response:
5050
"vue-tsc": "^2.0.29"
5151
},
5252
"peerDependencies": {
53-
53+
5454
}
5555
},
5656
...
@@ -68,8 +68,6 @@ PACKAGE_NAME is the name of package
6868
Response:
6969
```json
7070
{
71-
"packages": [
72-
{
7371
"name": "package-name",
7472
"version": "1.0.3",
7573
"type": "lib",
@@ -102,7 +100,7 @@ Response:
102100
"vue-tsc": "^2.0.29"
103101
},
104102
"peerDependencies": {
105-
103+
106104
},
107105
"dependenciesInfo": [
108106
{
@@ -138,24 +136,65 @@ Response:
138136
"packageDependencies": "",
139137
"createdAt": "2020-12-05T14:16:54.484Z",
140138
"updatedAt": "2020-12-09T14:35:49.183Z"
139+
}
140+
}
141+
```
142+
143+
## Update Package Configuration
144+
145+
```bash
146+
PUT /api/packages/update-config
147+
```
148+
Response:
149+
```json
150+
{
151+
"success": true,
152+
"message": "Package configuration updated successfully",
153+
{
154+
"name": "package-name",
155+
"version": "1.0.3",
156+
"type": "lib",
157+
"createdAt": "2020-12-05T10:43:14.208Z",
158+
"lastUpdated": "2020-12-05T10:43:14.208Z",
159+
"dependencies": {
160+
"@org/package2": "workspace:*",
161+
"vue": "^3.5.21"
141162
},
142-
"successRate": 50,
143-
"averageDuration": 1050000,
144-
"lastCommit": "abc1234",
145-
"lastCommitDate": "2020-12-09T14:08:18.949Z",
146-
"branch": "main",
147-
"isHealthy": false,
148-
"issues": []
163+
"maintainers": [],
164+
"path": "path-to-package",
165+
"description": "my package description",
166+
"license": "MIT",
167+
"repository": {
168+
"type": "git",
169+
"url": "http://github.com/reponame.git",
170+
"directory": "package/"
171+
},
172+
"scripts": {
173+
"dev": "vite",
174+
"build": "vite build",
175+
"build:check": "vue-tsc && vite build",
176+
"preview": "vite preview"
177+
},
178+
"devDependencies": {
179+
"@types/node": "^24.3.1",
180+
"@vitejs/plugin-vue": "^4.4.0",
181+
"typescript": "^5.7.2",
182+
"vite": "^4.4.5",
183+
"vue-tsc": "^2.0.29"
184+
},
185+
"peerDependencies": {
186+
187+
}
149188
},
150-
...
151-
],
189+
"preservedFields": true
152190
}
153191
```
154192

193+
155194
## Refresh Packages
156195

157196
```bash
158-
GET /api/packages/refresh
197+
POST /api/packages/refresh
159198
```
160199
Response:
161200
```json
@@ -194,7 +233,7 @@ Response:
194233
"vue-tsc": "^2.0.29"
195234
},
196235
"peerDependencies": {
197-
236+
198237
}
199238
},
200239
...

documentation/docs/features/package-scanning.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ Package scanning is the core of Monodog. It:
2222

2323
### 1. Workspace Detection
2424

25-
Monodog first identifies your monorepo type by looking for `package.json` with `"workspaces"` for npm workspaces.
25+
Monodog first identifies your packages by looking for `"workspaces"` in `package.json` or else `"packages"` in `pnpm-workspaces.yaml`.
2626

2727
### 2. Package Discovery
2828

@@ -80,7 +80,7 @@ Monodog examines:
8080
Start a scan via API:
8181

8282
```bash
83-
curl -X GET http://localhost:8999/api/packages/refresh
83+
curl -X POST http://localhost:8999/api/packages/refresh
8484
```
8585

8686
## Accessing Scan Results
@@ -107,7 +107,7 @@ Check your workspace configuration and included paths:
107107

108108
```bash
109109
# Verify config
110-
cat pnpm-workspace.yaml
110+
cat pnpm-workspace.yaml
111111
```
112112

113113
### Missing Dependencies
@@ -123,4 +123,4 @@ cat packages/my-package/package.json | grep -A 10 dependencies
123123

124124
- [Health Monitoring](/features/health-monitoring)
125125
- [Dependency Analysis](/features/dependency-analysis)
126-
- [API Reference - Packages](/api-reference/packages)
126+
- [API Reference - Packages](/api-reference/packages)

documentation/docs/getting-started/quick-start.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ Monodog can be started working within your monorepo in less than 5 minutes.
1212
In your monorepo root directory, run:
1313

1414
```bash
15-
pnpm dlx @mindfiredigital/monodog
15+
pnpm dlx @mindfiredigital/monodog
1616
```
1717
the installation script will create a new directory on project root: `monodog`
1818

@@ -32,13 +32,13 @@ npm run serve
3232

3333
You should see output like:
3434
```
35-
[monodog] Checking for monodog-conf.json
35+
[monodog] Checking for monodog-config.json
3636
Starting Monodog API server...
3737
Analyzing monorepo at root:
3838
Serving static files from:
39-
App listening on 0.0.0.0:3010
39+
App listening on localhost:3010
4040
[Database] Total packages found: 15
41-
🚀 Backend server running on http://0.0.0.0:8999
41+
🚀 Backend server running on http://localhost:8999
4242
```
4343

4444
## Step 3: Access the Dashboard
@@ -96,13 +96,13 @@ If Monodog is installed, you can explore:
9696

9797
### Port 3010 Already in Use
9898

99-
If port 3010 is already in use, specify a different port in monodog-conf.json:
99+
If port 3010 is already in use, specify a different port in monodog-config.json:
100100
```
101101
"dashboard": {
102102
"port": 3011
103103
}
104104
```
105-
If port 8999 is already in use, specify a different port in monodog-conf.json:
105+
If port 8999 is already in use, specify a different port in monodog-config.json:
106106
```
107107
"server": {
108108
"port": 8990

documentation/docs/installation/configure-monorepo.md

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,6 @@ Once Monodog is installed, configure it for your monorepo setup.
99

1010
## Supported Workspace Types
1111

12-
Monodog supports all major monorepo tools:
13-
1412
### pnpm Workspaces (Recommended)
1513

1614
If using pnpm workspaces, Monodog will auto-detect:
@@ -125,7 +123,7 @@ In order to install node packages in non-default locations, you will then need t
125123
```
126124
### Configure Workspaces Scanning
127125

128-
In order to scan only limited workspaces, you will then need to configure the `monodog-conf.json` file accordingly:
126+
In order to scan only limited workspaces, you will then need to configure the `monodog-config.json` file accordingly:
129127
```json
130128
{
131129
"workspaces": [

documentation/docs/installation/first-run.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,13 +24,13 @@ npm run serve
2424
You should see output like:
2525

2626
```
27-
[monodog] Checking for monodog-conf.json
27+
[monodog] Checking for monodog-config.json
2828
Starting Monodog API server...
2929
Analyzing monorepo at root:
3030
Serving static files from:
31-
App listening on 0.0.0.0:3010
31+
App listening on localhost:3010
3232
[Database] Total packages found: 15
33-
🚀 Backend server running on http://0.0.0.0:8999
33+
Backend server running on http://localhost:8999
3434
```
3535

3636
## Access the dashboard
@@ -129,7 +129,7 @@ This might take a few minutes depending on your monorepo size.
129129

130130
### Run on Custom Port
131131

132-
To run app on custom port update monodog-conf.json
132+
To run app on custom port update monodog-config.json
133133

134134
````json
135135
"server": {

documentation/docs/installation/install-npm.md

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -38,14 +38,12 @@ monodog/
3838
├── dist/ # Compiled JavaScript
3939
├── monodog-dashboard/ # Frontend
4040
│ ├── dist # Compiled JavaScript
41-
├── src/ # TypeScript source
4241
├── node_modules/ # Dependencies
4342
├── prisma/
44-
│ ├── schema.prisma # Database schema
43+
│ ├── schema/ # Database schema and database
4544
│ ├── migrations/ # Database migrations
46-
│ └── monodog.db # SQLite database
4745
├── package.json
48-
└── tsconfig.json
46+
└── monodog-config.json # Customize port, host and scan workspaces
4947
```
5048

5149

0 commit comments

Comments
 (0)