Skip to content

Commit d3cf05f

Browse files
feat(monodog): Merge pull request #14 from mindfiredigital/installable-package
Installable package
2 parents f9d35f1 + 712289d commit d3cf05f

File tree

238 files changed

+23831
-22484
lines changed

Some content is hidden

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

238 files changed

+23831
-22484
lines changed

.changeset/config.json

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
{
2+
"$schema": "https://unpkg.com/@changesets/config@3.0.5/schema.json",
3+
"changelog": [
4+
"@changesets/changelog-github",
5+
{ "repo": "mindfiredigital/monodog" }
6+
],
7+
"commit": false,
8+
"fixed": [],
9+
"linked": [],
10+
"access": "public",
11+
"baseBranch": "main",
12+
"updateInternalDependencies": "patch",
13+
"ignore": []
14+
}

.github/changeset-autogenerate.mjs

Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
import { execSync } from 'child_process';
2+
import fs from 'fs';
3+
4+
// Get the most recent commit message
5+
const commitMessage = execSync('git log -1 --format=%s').toString().trim();
6+
7+
// Define valid scopes
8+
const validScopes = [
9+
'monodog'
10+
];
11+
12+
// Define regex patterns
13+
const commitPatterns = {
14+
major: /^(feat|fix)\(([^)]+)\)!: (.+)/, // e.g., feat(scope)!: message
15+
minor: /^feat\(([^)]+)\): (.+)/, // Matches "feat(package-name): description" (without the "!" indicator)
16+
patch: /^fix\(([^)]+)\): (.+)/, // Matches "fix(package-name): description" (without the "!" indicator)
17+
};
18+
19+
// Identify type, package, and description
20+
let packageScope = null;
21+
let changeType = null;
22+
let description = null;
23+
24+
// 1. Check for Major Change using the "!" subject indicator
25+
if (commitPatterns.major.test(commitMessage)) {
26+
const scope = commitMessage.match(commitPatterns.major)?.[2];
27+
if (validScopes.includes(scope)) {
28+
changeType = 'major';
29+
packageScope = scope;
30+
description = commitMessage.match(commitPatterns.major)?.[3];
31+
}
32+
} else if (commitPatterns.minor.test(commitMessage)) {
33+
const scope = commitMessage.match(commitPatterns.minor)?.[1];
34+
if (validScopes.includes(scope)) {
35+
changeType = 'minor';
36+
packageScope = scope;
37+
description = commitMessage.match(commitPatterns.minor)?.[2];
38+
}
39+
} else if (commitPatterns.patch.test(commitMessage)) {
40+
const scope = commitMessage.match(commitPatterns.patch)?.[1];
41+
if (validScopes.includes(scope)) {
42+
changeType = 'patch';
43+
packageScope = scope;
44+
description = commitMessage.match(commitPatterns.patch)?.[2];
45+
}
46+
}
47+
48+
// Generate and write changeset if valid package found
49+
if (packageScope) {
50+
packageScope = packageScope.trim();
51+
description = description?.trim() || 'No description provided.';
52+
53+
// Determine the full package name based on scope
54+
const packageName =
55+
`@mindfiredigital/${packageScope}`;
56+
57+
// Generate changeset content
58+
const changesetContent = `---
59+
'${packageName}': ${changeType}
60+
---
61+
${description}
62+
`;
63+
64+
// Write to a changeset file
65+
fs.writeFileSync(`.changeset/auto-${Date.now()}.md`, changesetContent);
66+
console.log(`✅ Changeset file created for package: ${packageName}`);
67+
} else {
68+
console.log(
69+
'⚠️ No valid package scope found in commit message. Valid scopes are: monodog'
70+
);
71+
}

.github/pull_request_template.md

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
# Pull Request Description
2+
3+
This pull request addresses the following issue:
4+
5+
**Feature**: [GitHub Issue #<issue_number>](https://github.com/mindfiredigital/monodog/issues/<issue_number>)
6+
7+
### Changes Made:
8+
9+
- [List the main changes implemented]
10+
11+
## Screenshots (if appropriate):
12+
13+
[Add screenshots here]
14+
15+
### Checklist:
16+
17+
- [ ] [Specific task related to the feature]
18+
- [ ] [Another specific task]
19+
- [ ] Ensure all components are properly typed with TypeScript.
20+
- [ ] Add or update unit tests for new functionality.
21+
- [ ] Update documentation (comments, README, etc.) to reflect changes.
22+
- [ ] The file(s) or folder(s) now contain changes as specified in the issue I worked on.
23+
- [ ] Check build, test, lint and format by run running command `pnpm run build` at root directory.
24+
- [ ] I certify that I ran the checklist.
25+
26+
### Testing:
27+
28+
- [Describe how the feature was tested]
29+
30+
## Additional Notes:
31+
32+
[Add any additional information or context about the pull request here]
33+
34+
## Preview:
35+
36+
[Provide preview url(if available)]
37+
38+
## Closing
39+
40+
Closes #<issue_number>

.github/workflows/release-docs.yml

Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
name: Release docs Workflow
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
workflow_dispatch:
8+
9+
jobs:
10+
build:
11+
name: 'Build Docusaurus Documentation'
12+
runs-on: ubuntu-latest
13+
permissions:
14+
contents: write
15+
packages: read
16+
steps:
17+
- name: 'Checkout repository'
18+
uses: actions/checkout@v2
19+
20+
- name: Set up Node.js
21+
uses: actions/setup-node@v4
22+
with:
23+
node-version: 20
24+
env:
25+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
26+
27+
- name: 'Install dependencies and build'
28+
run: |
29+
cd documentation
30+
npm install
31+
npm run build
32+
33+
- name: 'Fetch branches'
34+
run: git fetch origin
35+
36+
- name: 'Set Git user name and email'
37+
run: |
38+
git config --local user.email "github-actions@github.com"
39+
git config --local user.name "GitHub Actions"
40+
41+
- name: 'Copy Docusaurus build artifacts to gh-pages branch'
42+
run: |
43+
# Create a temp directory to store the build files
44+
mkdir -p /tmp/temp-directory
45+
# Enable dotglob to copy hidden files (like .gitignore)
46+
shopt -s dotglob
47+
# Copy the build from the docs-docusaurus/build folder
48+
cp -r documentation/build/* /tmp/temp-directory/
49+
shopt -u dotglob
50+
# Stash any changes to prevent checkout conflicts
51+
git stash push
52+
# Switch to the gh-pages branch, creating it if it doesn't exist
53+
git checkout gh-pages || git checkout -b gh-pages
54+
# Remove all files from the gh-pages branch
55+
rm -rf *
56+
# Copy the build artifacts from the temp directory
57+
cp -r /tmp/temp-directory/* .
58+
# Check if there are any changes before committing
59+
if [[ -n "$(git status --porcelain)" ]]; then
60+
git add . -f
61+
git commit -m "chore(docs): copy docusaurus build artifacts to gh-pages branch"
62+
else
63+
echo "No changes to commit"
64+
fi
65+
66+
- name: Push to gh-pages
67+
env:
68+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
69+
run: |
70+
git push origin gh-pages --force || echo "No changes to push"
71+
72+
- name: 'Switch back to main branch'
73+
run: |
74+
git checkout main
75+
git stash pop || true # Restore stashed changes if any

.github/workflows/release.yml

Lines changed: 80 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,92 @@
1-
name: Release
1+
name: Deployment Workflow Monodog
22

33
on:
44
push:
5-
branches: [main]
5+
branches:
6+
- main
7+
workflow_dispatch:
68

79
jobs:
8-
release:
10+
build:
11+
name: "@mindfiredigital/monodog Build, Lint, and Test"
912
runs-on: ubuntu-latest
10-
if: github.ref == 'refs/heads/main'
11-
13+
permissions:
14+
contents: write # Required to create release tags and update the changelog
15+
issues: write # Required to close issues/PRs linked in the changelog
16+
pull-requests: write # Required for creating release pull requests (if configured)
17+
1218
steps:
13-
- uses: actions/checkout@v4
14-
with:
15-
fetch-depth: 0
16-
token: ${{ secrets.GITHUB_TOKEN }}
17-
18-
- name: Setup Node.js
19-
uses: actions/setup-node@v4
19+
- name: "Checkout repository"
20+
uses: actions/checkout@v3
21+
22+
- name: Set up Node.js
23+
uses: actions/setup-node@v3
2024
with:
21-
node-version-file: '.nvmrc'
22-
registry-url: 'https://registry.npmjs.org'
23-
25+
node-version: 20
26+
2427
- name: Setup pnpm
2528
uses: pnpm/action-setup@v2
2629
with:
2730
version: 8
28-
29-
- name: Install dependencies
30-
run: pnpm install --frozen-lockfile
31-
32-
- name: Build packages
33-
run: pnpm turbo build
34-
35-
- name: Run tests
36-
run: pnpm turbo test
31+
32+
- name: "Install dependencies"
33+
run: pnpm install --ignore-scripts --no-frozen-lockfile
34+
35+
- name: "Create build"
36+
run: pnpm run build
37+
38+
- name: "Lint code"
39+
run: pnpm run lint
40+
41+
- name: "Run tests"
42+
run: pnpm test
43+
44+
create-github-release:
45+
name: Create GitHub release document and publish to npm
46+
runs-on: ubuntu-latest
47+
needs: build
48+
permissions:
49+
contents: write
50+
pull-requests: write
51+
packages: write
52+
actions: write
53+
54+
steps:
55+
- name: Checkout repository
56+
uses: actions/checkout@v4
57+
with:
58+
fetch-depth: 0
59+
60+
- name: Set up Node.js
61+
uses: actions/setup-node@v4
62+
with:
63+
node-version: 20
64+
65+
- name: Enable Corepack
66+
run: npm install -g pnpm
67+
68+
- name: 'Install dependencies with pnpm'
69+
run: pnpm install --no-frozen-lockfile --ignore-scripts
70+
71+
- name: 'Build application'
72+
run: pnpm turbo run build
73+
74+
- name: 'Set Git user name and email'
75+
run: |
76+
git config --local user.email "github-actions@github.com"
77+
git config --local user.name "GitHub Actions"
78+
79+
- name: Generate Changeset from commit messages
80+
run: pnpm changeset:autogenerate
81+
82+
- name: Create Release Pull Request or Publish to npm
83+
id: changesets
84+
uses: changesets/action@v1.4.1
85+
with:
86+
publish: npx changeset publish
87+
env:
88+
# GITHUB_TOKEN is used for GitHub releases/tags/comments
89+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
90+
# NPM_TOKEN is used for publishing to the npm registry
91+
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
92+

.npmrc

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
shamefully-hoist=true
2+
strict-peer-dependencies=false
3+
auto-install-peers=true
4+
node-linker=pnpm
5+
6+
# Package publishing configs
7+
registry=https://registry.npmjs.org/
8+
always-auth=true
9+
10+
# Workspace configs
11+
link-workspace-packages=true
12+
save-workspace-protocol=true

LICENCE

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
MIT License
22

3-
Copyright (c) 2024 Lakin Mohapatra
3+
Copyright (c) 2025 Mindfire Digital LLP
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal
@@ -18,4 +18,4 @@ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
1818
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
1919
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
2020
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21-
SOFTWARE.
21+
SOFTWARE.

README.md

Lines changed: 17 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,37 @@
11
# MonoDog
22

3-
The dashboard will provide visual management and monitoring capabilities for packages in monorepos using pnpm, turbo, or Nx. It will be distributed as an npm package installable in any monorepo to auto-generate a web UI for package oversight.
3+
Monodog delivers centralized visual management and monitoring capabilities for packages across monorepos using pnpm. Distributed as an easy-to-install npm package, it auto-generates a dedicated web user interface (UI) to provide comprehensive oversight of your package ecosystem.
4+
<img width="1593" height="807" alt="package-scan" src="https://github.com/user-attachments/assets/d7e86b80-9f6a-4608-9103-68e6d660cc36" />
45

56
## Why MonoDog
67

7-
The Monorepo Dashboard addresses the complexity of managing many interconnected packages. It automates critical, error-prone tasks like semantic versioning and CI/CD, while providing immediate visual feedback on dependencies and package health. This optimization leads to faster development cycles and more reliable releases.
8+
The Monorepo Dashboard addresses the complexity of managing many interconnected packages. It automates critical, error-prone tasks, while providing immediate visual feedback on dependencies and package health. This optimization leads to faster development cycles and more reliable releases.
89

910
## Installation
1011

1112
Install dependencies:
1213

13-
pnpm install --ignore-scripts
14+
pnpm install
1415

1516
Build Setup:
1617

1718
pnpm run build
1819

19-
Run monoapp workspace using serve script:
20+
Run monodog workspace using serve script:
2021

21-
npm --workspace @monodog/monoapp run serve
22+
npm --workspace @mindfiredigital/monodog run serve
23+
24+
### Install Package in Monorepo
25+
26+
Install monodog in a monorepo workspace root:
27+
28+
pnpm dlx @mindfiredigital/monodog
29+
30+
Run app using serve script:
31+
32+
cd ./monodog/ && npm run serve
2233

2334
## License
2435

2536
Licensed under the MIT License, Copyright © Mindfire Solutions
37+

0 commit comments

Comments
 (0)