Skip to content

Commit b1d6a07

Browse files
feat(monodog): Merge pull request #16 from mindfiredigital/development
Release from Development
2 parents d5d1c16 + 20dbd56 commit b1d6a07

File tree

410 files changed

+65885
-3539
lines changed

Some content is hidden

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

410 files changed

+65885
-3539
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+
}

.editorconfig

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,6 @@
1010
insert_final_newline = true
1111

1212
[*.json]
13-
indent_size = 4
13+
indent_size = 4
14+
15+
#NIKHIL

.eslintrc.cjs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ module.exports = {
88
],
99
rules: {
1010
'@typescript-eslint/explicit-module-boundary-types': 'off',
11+
'@typescript-eslint/no-explicit-any': 'off',
12+
"@typescript-eslint/no-unused-vars": "off",
1113
},
1214
ignorePatterns: ['dist', 'node_modules', '**/*.js'],
1315
};

.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: 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+
// 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+

.gitignore

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ coverage
99
.nyc_output
1010

1111
# Build outputs
12-
dist
12+
# dist
1313
build
1414
out
1515
.next
@@ -71,3 +71,7 @@ Thumbs.db
7171

7272
# Do NOT ignore pnpm-lock.yaml
7373
!pnpm-lock.yaml
74+
75+
76+
*.db
77+
*.db-journal

.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

0 commit comments

Comments
 (0)