@manojkmfsi/monodog 1.2.4 → 1.2.6

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/CHANGELOG.md CHANGED
@@ -1,5 +1,15 @@
1
1
  # @manojkmfsi/monoapp
2
2
 
3
+ ## 1.2.6
4
+
5
+ ### Patch Changes
6
+
7
+ - [`5e51bc0`](https://github.com/manojkmfsi/monodog/commit/5e51bc00124a86beded3cf15ded889403549e487) - jhjhhkjhjhjhjhjhhkkhjhkj
8
+
9
+ - [`54b7a2a`](https://github.com/manojkmfsi/monodog/commit/54b7a2a1285e9b064c1da2df82713e9bae3bfac9) - yuuiuiuiuiuyiu
10
+
11
+ - [`02d394e`](https://github.com/manojkmfsi/monodog/commit/02d394ec8c47693dfef2822ce2b484cea59f7387) - nbnmbnnmbnmbnm
12
+
3
13
  ## 1.1.44
4
14
 
5
15
  ### Patch Changes
@@ -106,6 +106,14 @@ class ChangeTrackerService {
106
106
  */
107
107
  parseConventionalCommit(message, body) {
108
108
  const conventionalRegex = /^(feat|fix|docs|style|refactor|test|chore|perf|ci|revert|build)(\(.+\))?(!)?:\s(.+)/;
109
+ // Handle undefined or empty message
110
+ if (!message) {
111
+ return {
112
+ type: 'chore',
113
+ scope: undefined,
114
+ isBreaking: false,
115
+ };
116
+ }
109
117
  const match = message.match(conventionalRegex);
110
118
  if (!match) {
111
119
  return {
@@ -140,7 +148,7 @@ class ChangeTrackerService {
140
148
  .filter(line => line.trim())
141
149
  .map(line => {
142
150
  const [hash, email, author, timestamp, subject, body] = line.split('|||');
143
- const parsed = this.parseConventionalCommit(subject, body);
151
+ const parsed = this.parseConventionalCommit(subject || '', body);
144
152
  return {
145
153
  hash,
146
154
  message: subject,
@@ -175,7 +183,7 @@ class ChangeTrackerService {
175
183
  .filter(line => line.trim())
176
184
  .map(line => {
177
185
  const [hash, email, author, timestamp, subject, body] = line.split('|||');
178
- const parsed = this.parseConventionalCommit(subject, body);
186
+ const parsed = this.parseConventionalCommit(subject || '', body);
179
187
  return {
180
188
  hash,
181
189
  message: subject,
@@ -1,8 +1,42 @@
1
1
  "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || (function () {
19
+ var ownKeys = function(o) {
20
+ ownKeys = Object.getOwnPropertyNames || function (o) {
21
+ var ar = [];
22
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23
+ return ar;
24
+ };
25
+ return ownKeys(o);
26
+ };
27
+ return function (mod) {
28
+ if (mod && mod.__esModule) return mod;
29
+ var result = {};
30
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31
+ __setModuleDefault(result, mod);
32
+ return result;
33
+ };
34
+ })();
2
35
  Object.defineProperty(exports, "__esModule", { value: true });
3
36
  exports.publishPipelineService = exports.PublishPipelineService = void 0;
4
- const client_1 = require("@prisma/client");
5
- const prisma = new client_1.PrismaClient();
37
+ const PrismaPkg = __importStar(require("@prisma/client"));
38
+ const PrismaClient = PrismaPkg.PrismaClient || PrismaPkg.default || PrismaPkg;
39
+ const prisma = new PrismaClient();
6
40
  class PublishPipelineService {
7
41
  /**
8
42
  * Create a new publish pipeline record
@@ -51,12 +85,6 @@ class PublishPipelineService {
51
85
  orderBy: { newVersion: 'desc' },
52
86
  });
53
87
  }
54
- /**
55
- * Log a token usage event
56
- */
57
- async logTokenUsage(data) {
58
- return prisma.tokenUsageLog.create({ data: data });
59
- }
60
88
  }
61
89
  exports.PublishPipelineService = PublishPipelineService;
62
90
  exports.publishPipelineService = new PublishPipelineService();
@@ -5,6 +5,39 @@
5
5
  * 1. NodePublishRunner: Direct npm publishing via Node.js
6
6
  * 2. GitHubActionsPublishRunner: Delegate to GitHub Actions workflow
7
7
  */
8
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
9
+ if (k2 === undefined) k2 = k;
10
+ var desc = Object.getOwnPropertyDescriptor(m, k);
11
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
12
+ desc = { enumerable: true, get: function() { return m[k]; } };
13
+ }
14
+ Object.defineProperty(o, k2, desc);
15
+ }) : (function(o, m, k, k2) {
16
+ if (k2 === undefined) k2 = k;
17
+ o[k2] = m[k];
18
+ }));
19
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
20
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
21
+ }) : function(o, v) {
22
+ o["default"] = v;
23
+ });
24
+ var __importStar = (this && this.__importStar) || (function () {
25
+ var ownKeys = function(o) {
26
+ ownKeys = Object.getOwnPropertyNames || function (o) {
27
+ var ar = [];
28
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
29
+ return ar;
30
+ };
31
+ return ownKeys(o);
32
+ };
33
+ return function (mod) {
34
+ if (mod && mod.__esModule) return mod;
35
+ var result = {};
36
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
37
+ __setModuleDefault(result, mod);
38
+ return result;
39
+ };
40
+ })();
8
41
  var __importDefault = (this && this.__importDefault) || function (mod) {
9
42
  return (mod && mod.__esModule) ? mod : { "default": mod };
10
43
  };
@@ -16,6 +49,9 @@ const npm_publish_service_1 = require("./npm-publish-service");
16
49
  const change_tracker_service_1 = require("./change-tracker-service");
17
50
  const fs_1 = __importDefault(require("fs"));
18
51
  const path_1 = __importDefault(require("path"));
52
+ const PrismaPkg = __importStar(require("@prisma/client"));
53
+ const PrismaClient = PrismaPkg.PrismaClient || PrismaPkg.default || PrismaPkg; // Import the validateConfig function from your utils
54
+ const prisma = new PrismaClient();
19
55
  const execAsync = (0, util_1.promisify)(child_process_1.exec);
20
56
  /**
21
57
  * Base abstract class for publish runners
@@ -64,7 +100,7 @@ class NodePublishRunner extends PublishRunner {
64
100
  this.log(`🔗 Checking for dependent packages...`);
65
101
  const dependents = await this.getPackageDependents(packageName);
66
102
  if (dependents.length > 0 && !dryRun) {
67
- this.log(` Updating versions in dependents: ${dependents.join(', ')}`);
103
+ this.log(`Todo: Updating versions in dependents: ${dependents.join(', ')}`);
68
104
  // Dependents would be updated in cascade
69
105
  }
70
106
  // 4. Commit changes to git
@@ -155,6 +191,7 @@ class NodePublishRunner extends PublishRunner {
155
191
  }
156
192
  }
157
193
  async createGitHubRelease(packageName, version, githubToken) {
194
+ //TODO
158
195
  // This would call GitHub API to create release
159
196
  // Placeholder for now - would be implemented with full GitHub integration
160
197
  const releaseUrl = `https://github.com/owner/repo/releases/tag/${packageName}-v${version}`;
@@ -165,8 +202,28 @@ class NodePublishRunner extends PublishRunner {
165
202
  return '';
166
203
  }
167
204
  async getPackageDependents(packageName) {
168
- // Return list of packages that depend on this one
169
- return [];
205
+ // List of all package.json paths in the monorepo
206
+ const packages = await prisma.package.findMany();
207
+ // 2. Now you can safely map over the resulting array
208
+ const packageJsonPaths = packages.map((pkg) => path_1.default.join(pkg.path, 'package.json'));
209
+ const dependents = [];
210
+ for (const pkgPath of packageJsonPaths) {
211
+ let pkg;
212
+ try {
213
+ pkg = JSON.parse(fs_1.default.readFileSync(pkgPath, 'utf8'));
214
+ }
215
+ catch {
216
+ continue;
217
+ }
218
+ const deps = pkg['dependencies'] || {};
219
+ if (deps[packageName]) {
220
+ if (pkg.name && !dependents.includes(pkg.name)) {
221
+ dependents.push(pkg.name);
222
+ }
223
+ }
224
+ }
225
+ console.log(dependents);
226
+ return dependents;
170
227
  }
171
228
  }
172
229
  exports.NodePublishRunner = NodePublishRunner;
package/dist/setup.js CHANGED
File without changes
@@ -0,0 +1,58 @@
1
+ # Monodog: Monorepo Health Dashboard (Frontend)
2
+
3
+ ## 🎯 Overview
4
+
5
+ This is the **client-side application** designed to consume data from the **Monorepo Analytics and Health API** backend service.
6
+ It provides a **real-time, visual dashboard** for tracking the health, dependencies, and overall status of all packages within the monorepo.
7
+
8
+ ---
9
+
10
+ ## 🛠 Technology Stack
11
+
12
+ | Component | Technology | Description |
13
+ | ----------------- | ----------------------------- | --------------------------------------------------------------------- |
14
+ | **Framework** | React (Functional Components) | Core library for building the user interface. |
15
+ | **Styling** | Tailwind CSS | Utility-first framework for responsive, modern, and aesthetic design. |
16
+ | **Data Fetching** | Fetch API (Native JavaScript) | Handles communication with the backend Express API. |
17
+ | **Icons** | Lucide React | Simple, clean vector icons for visualization. |
18
+
19
+ ---
20
+
21
+ ## ⚙️ Prerequisites
22
+
23
+ To run this application, ensure the following:
24
+
25
+ - **Node.js** and a package manager (`npm`, `yarn`, or `pnpm`) are installed.
26
+ - The **Monorepo Analytics API** backend service is running and accessible.
27
+ - Default backend URL: **http://localhost:8999**
28
+
29
+ ---
30
+
31
+ ## API Connection Details
32
+
33
+ The dashboard connects to the backend API using the following base URL:
34
+
35
+ ```javascript
36
+ const API_BASE_URL = 'http://localhost:8999/api';
37
+ ```
38
+
39
+ ## Getting Started
40
+
41
+ ### Installation
42
+
43
+ Clone the repository and install the dependencies:
44
+
45
+ ```bash
46
+ # Clone the repository
47
+ git clone https://github.com/mindfiredigital/MonoDog.git
48
+ cd packages/monoapp/monodog-dashboard
49
+
50
+ # Install dependencies
51
+ npm install
52
+
53
+ # build
54
+ npm run build
55
+
56
+ # run dashboard
57
+ npm run dev
58
+ ```
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@manojkmfsi/monodog",
3
- "version": "1.2.4",
3
+ "version": "1.2.6",
4
4
  "description": "App for monodog monorepo",
5
5
  "license": "MIT",
6
6
  "author": "Mindfiredigital",
@@ -28,23 +28,6 @@
28
28
  "bin": {
29
29
  "monodog": "dist/setup.js"
30
30
  },
31
- "scripts": {
32
- "dev": "DATABASE_URL=$(npm run db:url --silent 2>/dev/null | tr -d '\\n') tsx watch src/serve.ts --dev --debug",
33
- "serve": "DATABASE_URL=$(npm run db:url --silent 2>/dev/null | tr -d '\\n') tsx dist/serve.js",
34
- "prepublishOnly": "pnpm build",
35
- "build": "rm -rf dist && tsc",
36
- "test:coverage": "jest --coverage --silent",
37
- "prestart": "npm run build",
38
- "clean": "rm -rf dist node_modules/.cache",
39
- "lint": "eslint .",
40
- "lint:fix": "eslint . --fix",
41
- "db:url": "node dist/get-db-url.js",
42
- "schema:format": "DATABASE_URL=$(npm run db:url --silent 2>/dev/null | tr -d '\\n') prisma format",
43
- "schema:validate": "DATABASE_URL=$(npm run db:url --silent 2>/dev/null | tr -d '\\n') prisma validate",
44
- "generate": "DATABASE_URL=$(npm run db:url --silent 2>/dev/null | tr -d '\\n') prisma generate",
45
- "migrate": "DATABASE_URL=$(npm run db:url --silent 2>/dev/null | tr -d '\\n') prisma migrate deploy",
46
- "migrate:reset": "DATABASE_URL=$(npm run db:url --silent 2>/dev/null | tr -d '\\n') prisma migrate reset --force"
47
- },
48
31
  "keywords": [
49
32
  "monodog",
50
33
  "monorepo",
@@ -108,5 +91,21 @@
108
91
  },
109
92
  "prisma": {
110
93
  "schema": "./prisma/schema"
94
+ },
95
+ "scripts": {
96
+ "dev": "DATABASE_URL=$(npm run db:url --silent 2>/dev/null | tr -d '\\n') tsx watch src/serve.ts --dev --debug",
97
+ "serve": "DATABASE_URL=$(npm run db:url --silent 2>/dev/null | tr -d '\\n') tsx dist/serve.js",
98
+ "build": "rm -rf dist && tsc",
99
+ "test:coverage": "jest --coverage --silent",
100
+ "prestart": "npm run build",
101
+ "clean": "rm -rf dist node_modules/.cache",
102
+ "lint": "eslint .",
103
+ "lint:fix": "eslint . --fix",
104
+ "db:url": "node dist/get-db-url.js",
105
+ "schema:format": "DATABASE_URL=$(npm run db:url --silent 2>/dev/null | tr -d '\\n') prisma format",
106
+ "schema:validate": "DATABASE_URL=$(npm run db:url --silent 2>/dev/null | tr -d '\\n') prisma validate",
107
+ "generate": "DATABASE_URL=$(npm run db:url --silent 2>/dev/null | tr -d '\\n') prisma generate",
108
+ "migrate": "DATABASE_URL=$(npm run db:url --silent 2>/dev/null | tr -d '\\n') prisma migrate deploy",
109
+ "migrate:reset": "DATABASE_URL=$(npm run db:url --silent 2>/dev/null | tr -d '\\n') prisma migrate reset --force"
111
110
  }
112
- }
111
+ }
Binary file