Skip to content
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 0 additions & 3 deletions .commitlintrc.js

This file was deleted.

30 changes: 30 additions & 0 deletions .commitlintrc.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
import type { UserConfig } from "@commitlint/types"; // [!code focus]
import { RuleConfigSeverity } from "@commitlint/types"; // [!code focus]

const Configuration: UserConfig = {
// [!code focus]
extends: ["@commitlint/config-conventional"],
parserPreset: "conventional-changelog-atom",
formatter: "@commitlint/format",
rules: {
"type-enum": [
RuleConfigSeverity.Error,
"always",
[
"chore",
"feat",
"fix",
"docs",
"style",
"refactor",
"test",
"revert",
"build",
"ci",
],
],
},
// ...
};

export default Configuration;
17 changes: 17 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
name: CI
on:
push:
branches-ignore:
- main
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 20.x
- run: npm ci
- run: npm run build
- run: npm run lint
- run: npm test
40 changes: 0 additions & 40 deletions .github/workflows/npm-publish.yml

This file was deleted.

50 changes: 50 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
name: Release
on:
push:
branches: [main]

jobs:
# install, lint, build and test
test:
name: TEst
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: "lts/*"

#next only install build and release package
release:
name: Release
needs: test
runs-on: ubuntu-latest
permissions:
contents: write # to be able to publish a GitHub release
issues: write # to be able to comment on released issues
pull-requests: write # to be able to comment on released pull requests
id-token: write # to enable use of OIDC for npm provenance
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: "lts/*"
- name: Install dependencies
run: npm clean-install
- name: build the package
run: npm run build
- name: Verify the integrity of provenance attestations and registry signatures for installed dependencies
run: npm audit signatures
- name: Release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
run: npx semantic-release
1 change: 1 addition & 0 deletions .husky/commit-msg
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
npx --no -- commitlint --edit "$1"
1 change: 1 addition & 0 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
npm run ci
1 change: 1 addition & 0 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
engine-strict = true
17 changes: 17 additions & 0 deletions .releaserc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"branches": ["main"],
"plugins": [
"@semantic-release/commit-analyzer",
"@semantic-release/release-notes-generator",
"@semantic-release/changelog",
"@semantic-release/npm",
"@semantic-release/github",
[
"@semantic-release/git",
{
"assets": ["CHANGELOG.md", "package.json"],
"message": "chore(release): ${nextRelease.version} [skip ci]\n\n${nextRelease.notes}"
}
]
]
}
20 changes: 20 additions & 0 deletions ARCHITECTURE.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,27 @@ mcp-server-ragdocs/

## Design Decisions

- **Semantic Versioning**: Strict adherence to SemVer through commit conventions and automated releases
- Modular architecture for easy embedding provider swaps
- Batch processing for scalability
- Type-safe implementation with TypeScript
- Convention-over-configuration for handler registration
- npm package manager enforcement via engine-strict configuration

## CI/CD Pipeline

### Release Workflow

1. Semantic-release analyzes commits
2. Automatically bumps version based on commit types
3. Generates changelog
4. Publishes to npm registry
5. Creates GitHub release

### Quality Gates

- All tests must pass
- 100% code coverage enforcement
- Linting/formatting checks
- Commit message validation
- Dependency vulnerability scanning
67 changes: 60 additions & 7 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,11 @@ git clone https://github.com/your-username/mcp-server-ragdocs.git
cd mcp-server-ragdocs
```

2. Install dependencies:
2. Install dependencies (npm required):

```bash
npm install
# Enforced by .npmrc engine-strict=true
```

3. Build the project:
Expand All @@ -32,7 +33,37 @@ npm run build

### Commit Process

NOTE Write the process out in a better way!
### Commit Validation Workflow

We enforce commit standards through:

- [Husky](https://typicode.github.io/husky/) pre-commit hooks
- [commitlint](https://commitlint.js.org/) message validation
- npm-enforced package manager via `.npmrc`

#### Hook Configuration

```bash
# .husky/pre-commit
#!/usr/bin/env sh
. "$(dirname -- "$0")/_/husky.sh"

npm run lint
```

1. Stage changes with `git add`
2. Attempt commit - validation runs automatically
3. If rejected:
- Fix message format
- Retry commit

Example workflow:

```bash
git add .
git commit -m "invalid message" # Fails
git commit -m "feat: add validation workflow" # Succeeds
```

### Pull Requests

Expand All @@ -50,20 +81,32 @@ NOTE Write the process out in a better way!

## Commit Message Format

We enforce [Conventional Commits](https://www.conventionalcommits.org) using automated validation:
We enforce [Conventional Commits](https://www.conventionalcommits.org) specification:

```
<type>(<scope>): <description>
```

### Allowed Types:

- feat: New feature
- fix: Bug fix
- docs: Documentation changes
- chore: Maintenance tasks
- feat: New features
- fix: Bug fixes
- docs: Documentation changes
- style: Code formatting
- refactor: Code refactoring
- test: Test additions/modifications
- test: Test updates
- revert: Revert changes
- build: Build system updates
- ci: CI configuration changes

Examples:

```bash
feat: add documentation search endpoint
fix: resolve timeout issues in queue processing
docs: update API reference documentation
```

## Pull Request Process

Expand All @@ -87,3 +130,13 @@ We enforce [Conventional Commits](https://www.conventionalcommits.org) using aut
- All PRs require maintainer approval
- Address review comments promptly
- Keep discussion focused on the code

## Release Process

This project uses semantic-release for automated version management:

- Commits must follow Conventional Commits specification
- Merges to `main` trigger automated releases
- Patch versions for `fix` commits
- Minor versions for `feat` commits
- Major versions for breaking changes (`BREAKING CHANGE` in footer)
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
- [Contributing](#contributing)
- [Forkception Acknowledgments](#forkception-acknowledgments)

[![Node.js Package](https://github.com/sanderkooger/mcp-server-ragdocs/actions/workflows/npm-publish.yml/badge.svg)](https://github.com/sanderkooger/mcp-server-ragdocs/actions/workflows/npm-publish.yml)
[![Node.js Package](https://github.com/sanderkooger/mcp-server-ragdocs/actions/workflows/release.yml/badge.svg)](https://github.com/sanderkooger/mcp-server-ragdocs/actions/workflows/npm-publish.yml)
![NPM Downloads](https://img.shields.io/npm/dy/%40sanderkooger%2Fmcp-server-ragdocs)
[![Version](https://img.shields.io/npm/v/@sanderkooger/mcp-server-ragdocs)](https://npmjs.com/package/@sanderkooger/mcp-server-ragdocs)
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
Expand Down
Loading