Skip to content

Commit 526e583

Browse files
authored
Merge branch 'main' into main
2 parents f9c6b5b + 3e97c76 commit 526e583

File tree

11 files changed

+9150
-2338
lines changed

11 files changed

+9150
-2338
lines changed

.github/pull_request_template.md

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
## Description
2+
<!-- Provide a brief description of your changes -->
3+
4+
## Type of Change
5+
<!-- Check the type that applies to your PR -->
6+
- [ ] 🐛 Bug fix (non-breaking change which fixes an issue)
7+
- [ ] ✨ New feature (non-breaking change which adds functionality)
8+
- [ ] 💥 Breaking change (fix or feature that would cause existing functionality to not work as expected)
9+
- [ ] 📚 Documentation update
10+
- [ ] 🎨 Code style/formatting changes
11+
- [ ] ♻️ Refactoring (no functional changes)
12+
- [ ] ⚡ Performance improvements
13+
- [ ] ✅ Test additions or updates
14+
- [ ] 🔧 Chore (maintenance, dependencies, CI, etc.)
15+
16+
## Affected Components
17+
<!-- Check all that apply -->
18+
- [ ] CLI (`cli/`)
19+
- [ ] Shared (`shared/`)
20+
- [ ] CALM Widgets (`calm-widgets/`)
21+
- [ ] CALM Hub (`calm-hub/`)
22+
- [ ] CALM Hub UI (`calm-hub-ui/`)
23+
- [ ] Documentation (`docs/`)
24+
- [ ] VS Code Extension (`calm-plugins/vscode/`)
25+
- [ ] Dependencies
26+
- [ ] CI/CD
27+
28+
## Commit Message Format ✅
29+
<!--
30+
Make sure your commit messages follow the conventional commit format:
31+
type(scope): description
32+
33+
Scope is optional but recommended - you can use ./commit-helper.sh to get suggestions!
34+
35+
Examples:
36+
- feat(cli): add new validation command
37+
- fix(shared): resolve schema parsing issue
38+
- docs: update installation guide
39+
- chore(deps): bump typescript to 5.8.3
40+
41+
This helps with our automated versioning and changelog generation!
42+
Note: Only commits with (cli) scope will trigger CLI releases.
43+
-->
44+
45+
## Testing
46+
<!-- Describe how you tested your changes -->
47+
- [ ] I have tested my changes locally
48+
- [ ] I have added/updated unit tests
49+
- [ ] All existing tests pass
50+
51+
## Checklist
52+
- [ ] My commits follow the [conventional commit format](https://www.conventionalcommits.org/)
53+
- [ ] I have updated documentation if necessary
54+
- [ ] I have added tests for my changes (if applicable)
55+
- [ ] My changes follow the project's coding standards

.github/workflows/publish-cli-to-npm.yml

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
name: Publish CLI to NPM
22

33
permissions:
4-
contents: read
4+
contents: write # needed for semantic-release to create releases and update files
5+
issues: write # needed for semantic-release to comment on issues
6+
pull-requests: write # needed for semantic-release to comment on PRs
57

68
on:
79
release:
@@ -14,6 +16,8 @@ jobs:
1416
# Checkout the code
1517
- name: Checkout code
1618
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
19+
with:
20+
fetch-depth: 0 # semantic-release needs full git history
1721

1822
# Set up Node.js
1923
- name: Setup Node.js
@@ -30,7 +34,14 @@ jobs:
3034
- name: Build workspace
3135
run: npm run build
3236

33-
# Publish the CLI module
37+
# Update CLI version using semantic-release
38+
- name: Update CLI version with semantic-release
39+
run: npm run semantic-release --workspace cli
40+
env:
41+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
42+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
43+
44+
# Publish the CLI module (semantic-release will handle this, but keeping as fallback)
3445
- name: Publish CLI module
3546
run: npm publish --workspace cli
3647
env:
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
name: Validate Commit Messages
2+
3+
permissions:
4+
contents: read
5+
6+
on:
7+
pull_request:
8+
types: [opened, edited, synchronize]
9+
10+
jobs:
11+
commitlint:
12+
runs-on: ubuntu-latest
13+
steps:
14+
- name: Checkout code
15+
uses: actions/checkout@v4
16+
with:
17+
fetch-depth: 0
18+
19+
- name: Setup Node.js
20+
uses: actions/setup-node@v4
21+
with:
22+
node-version: 22
23+
cache: npm
24+
25+
- name: Install dependencies
26+
run: npm ci
27+
28+
- name: Validate all commits in PR
29+
run: |
30+
echo "� Validating commit messages from base branch to HEAD..."
31+
npx commitlint --from ${{ github.event.pull_request.base.sha }} --to HEAD --verbose
32+
33+
- name: Display validation summary
34+
if: failure()
35+
run: |
36+
echo "## 🚨 Commit Message Validation Failed" >> $GITHUB_STEP_SUMMARY
37+
echo "" >> $GITHUB_STEP_SUMMARY
38+
echo "Your commit messages don't follow our conventional commit format." >> $GITHUB_STEP_SUMMARY
39+
echo "" >> $GITHUB_STEP_SUMMARY
40+
echo "### ✅ Valid Format" >> $GITHUB_STEP_SUMMARY
41+
echo "\`<type>(<scope>): <description>\`" >> $GITHUB_STEP_SUMMARY
42+
echo "" >> $GITHUB_STEP_SUMMARY
43+
echo "### 🎯 Examples" >> $GITHUB_STEP_SUMMARY
44+
echo "- \`feat(cli): add semantic versioning support\`" >> $GITHUB_STEP_SUMMARY
45+
echo "- \`fix(shared): resolve validation error\`" >> $GITHUB_STEP_SUMMARY
46+
echo "- \`docs: update installation instructions\`" >> $GITHUB_STEP_SUMMARY
47+
echo "" >> $GITHUB_STEP_SUMMARY
48+
echo "### 🛠️ How to Fix" >> $GITHUB_STEP_SUMMARY
49+
echo "1. Use \`git rebase -i\` to rewrite commit messages" >> $GITHUB_STEP_SUMMARY
50+
echo "2. Follow the format: \`<type>(<scope>): <description>\`" >> $GITHUB_STEP_SUMMARY

brand/CALM 1.0 background.png

183 KB
Loading

cli/.releaserc.json

Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
{
2+
"branches": [
3+
"main"
4+
],
5+
"repositoryUrl": "https://github.com/finos/architecture-as-code",
6+
"tagFormat": "cli-v${version}",
7+
"plugins": [
8+
[
9+
"@semantic-release/commit-analyzer",
10+
{
11+
"preset": "conventionalcommits",
12+
"releaseRules": [
13+
{ "type": "feat", "scope": "cli", "release": "minor" },
14+
{ "type": "fix", "scope": "cli", "release": "patch" },
15+
{ "type": "perf", "scope": "cli", "release": "patch" },
16+
{ "type": "revert", "scope": "cli", "release": "patch" },
17+
{ "type": "docs", "scope": "cli", "release": "patch" },
18+
{ "type": "chore", "scope": "cli", "release": false },
19+
{ "type": "refactor", "scope": "cli", "release": "patch" },
20+
{ "type": "test", "scope": "cli", "release": false },
21+
{ "type": "style", "scope": "cli", "release": false },
22+
{ "type": "ci", "scope": "cli", "release": false },
23+
{ "scope": "!cli", "release": false }
24+
]
25+
}
26+
],
27+
[
28+
"@semantic-release/release-notes-generator",
29+
{
30+
"preset": "conventionalcommits",
31+
"presetConfig": {
32+
"types": [
33+
{ "type": "feat", "section": "🚀 Features" },
34+
{ "type": "fix", "section": "🐛 Bug Fixes" },
35+
{ "type": "perf", "section": "⚡ Performance Improvements" },
36+
{ "type": "revert", "section": "⏪ Reverts" },
37+
{ "type": "docs", "section": "📚 Documentation" },
38+
{ "type": "refactor", "section": "♻️ Code Refactoring" },
39+
{ "type": "test", "section": "✅ Tests", "hidden": true },
40+
{ "type": "style", "section": "🎨 Styles", "hidden": true },
41+
{ "type": "chore", "section": "🔧 Chores", "hidden": true },
42+
{ "type": "ci", "section": "🤖 CI/CD", "hidden": true }
43+
]
44+
}
45+
}
46+
],
47+
[
48+
"@semantic-release/changelog",
49+
{
50+
"changelogFile": "CHANGELOG.md",
51+
"changelogTitle": "# Changelog\n\nAll notable changes to the CALM CLI will be documented in this file.\n\nThe format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),\nand this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html)."
52+
}
53+
],
54+
"@semantic-release/npm",
55+
[
56+
"@semantic-release/git",
57+
{
58+
"assets": [
59+
"package.json",
60+
"CHANGELOG.md"
61+
],
62+
"message": "chore(cli): release ${nextRelease.version} [skip ci]\n\n${nextRelease.notes}"
63+
}
64+
],
65+
[
66+
"@semantic-release/github",
67+
{
68+
"assets": [
69+
{
70+
"path": "dist/**/*",
71+
"label": "CLI Distribution"
72+
}
73+
]
74+
}
75+
]
76+
]
77+
}

cli/CHANGELOG.md

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# Changelog
2+
3+
All notable changes to the CALM CLI will be documented in this file.
4+
5+
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
6+
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7+
8+
## [Unreleased]
9+
10+
### Added
11+
- Introduced semantic-release for automated version management
12+
- Added conventional commit validation
13+
- Automated changelog generation
14+
15+
## [1.0.0] - 2025-08-21
16+
17+
### Added
18+
- Initial stable release of CALM CLI
19+
- Support for CALM schema validation
20+
- Documentation generation capabilities
21+
- Widget support for enhanced functionality
22+
23+
[Unreleased]: https://github.com/finos/architecture-as-code/compare/v1.0.0...HEAD
24+
[1.0.0]: https://github.com/finos/architecture-as-code/releases/tag/v1.0.0

cli/package.json

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,8 @@
2323
"test": "vitest run",
2424
"lint": "eslint src",
2525
"lint-fix": "eslint src --fix",
26-
"dependency-check": "dependency-check --project 'calm-cli' --scan . --out ./dependency-check-report --format ALL --suppression ../.github/node-cve-ignore-list.xml"
26+
"dependency-check": "dependency-check --project 'calm-cli' --scan . --out ./dependency-check-report --format ALL --suppression ../.github/node-cve-ignore-list.xml",
27+
"semantic-release": "semantic-release"
2728
},
2829
"publishConfig": {
2930
"access": "public"
@@ -45,6 +46,9 @@
4546
"ts-node": "10.9.2"
4647
},
4748
"devDependencies": {
49+
"@semantic-release/changelog": "^6.0.3",
50+
"@semantic-release/git": "^10.0.1",
51+
"@semantic-release/github": "^11.0.0",
4852
"@types/json-pointer": "^1.0.34",
4953
"@types/junit-report-builder": "^3.0.2",
5054
"@types/lodash": "^4.17.16",
@@ -58,6 +62,7 @@
5862
"eslint": "^9.24.0",
5963
"globals": "^16.0.0",
6064
"link": "^2.1.1",
65+
"semantic-release": "^24.0.0",
6166
"supertest": "^7.1.0",
6267
"tsup": "^8.4.0",
6368
"typescript": "^5.8.3",

cli/src/cli.e2e.spec.ts

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -462,10 +462,6 @@ describe('CLI Integration Tests', () => {
462462
'../../cli/test_fixtures/getting-started'
463463
);
464464

465-
// This will enforce that people verify the getting-started guide works prior to any cli change
466-
const { stdout } = await run(calm(), ['--version']);
467-
expect(stdout.trim()).toMatch('1.0.0'); // basic semver check
468-
469465
//STEP 1: Generate Architecture From Pattern
470466
const inputPattern = path.resolve(
471467
GETTING_STARTED_DIR,

commitlint.config.js

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
module.exports = {
2+
extends: ['@commitlint/config-conventional'],
3+
rules: {
4+
// Allow empty scope - we'll auto-detect it from changed files
5+
'scope-empty': [0, 'never'],
6+
'scope-enum': [
7+
1, // Warning level instead of error
8+
'always',
9+
[
10+
'cli',
11+
'shared',
12+
'calm-widgets',
13+
'calm-hub',
14+
'calm-hub-ui',
15+
'docs',
16+
'vscode',
17+
'deps',
18+
'ci',
19+
'release'
20+
]
21+
],
22+
'subject-case': [2, 'always', 'lower-case'],
23+
'subject-empty': [2, 'never'],
24+
'subject-full-stop': [2, 'never', '.'],
25+
'type-case': [2, 'always', 'lower-case'],
26+
'type-empty': [2, 'never'],
27+
'type-enum': [
28+
2,
29+
'always',
30+
[
31+
'build',
32+
'chore',
33+
'ci',
34+
'docs',
35+
'feat',
36+
'fix',
37+
'perf',
38+
'refactor',
39+
'revert',
40+
'style',
41+
'test'
42+
]
43+
],
44+
// Disable body line length enforcement - we only care about type and description
45+
'body-max-line-length': [0, 'always']
46+
}
47+
};

0 commit comments

Comments
 (0)