name: Publish to NPM
on:
push:
tags:
- "v*"
workflow_dispatch:
jobs:
publish:
runs-on: ubuntu-latest
permissions:
contents: write
id-token: write
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v5
with:
node-version: "20"
registry-url: "https://registry.npmjs.org"
scope: "@julianoczkowski"
- name: Update npm to latest (required for OIDC)
run: npm install -g npm@latest
- name: Install dependencies
run: npm ci
- name: Download documentation
run: node download-docs.js
- name: Build package
run: npm run build
- name: Verify documentation
run: |
echo "Checking documentation files..."
DOC_COUNT=$(ls docs/*.md 2>/dev/null | wc -l)
echo "Found $DOC_COUNT documentation files"
if [ "$DOC_COUNT" -lt 40 ]; then
echo "Error: Expected at least 40 documentation files, found $DOC_COUNT"
exit 1
fi
echo "✓ Documentation check passed"
- name: Run tests
run: npm test --if-present
- name: Verify npm authentication and OIDC
run: |
echo "=== OIDC Token Debug ==="
echo "GITHUB_REPOSITORY: ${{ github.repository }}"
echo "GITHUB_REF: ${{ github.ref }}"
echo "GITHUB_WORKFLOW_REF: ${{ github.workflow_ref }}"
echo ""
echo "=== Checking npm configuration ==="
npm config list
echo ""
echo "=== Checking .npmrc ==="
cat ~/.npmrc 2>/dev/null || echo "No .npmrc file found"
echo ""
echo "=== Checking package existence ==="
npm view @julianoczkowski/mcp-modus --registry=https://registry.npmjs.org || echo "Package check completed"
- name: Publish to NPM
run: npm publish --access public
env:
NODE_AUTH_TOKEN: ""
- name: Extract version from tag
id: version
run: echo "VERSION=${GITHUB_REF#refs/tags/v}" >> $GITHUB_OUTPUT
- name: Create GitHub Release
uses: softprops/action-gh-release@v2
with:
tag_name: v${{ steps.version.outputs.VERSION }}
name: Release v${{ steps.version.outputs.VERSION }}
body: |
## MCP Modus v${{ steps.version.outputs.VERSION }}
### 🔒 Security & Reliability Improvements
- **Pre-bundled Documentation**: All docs included with package - no runtime downloads
- **Enhanced Security**: Removed postinstall hooks for safer installation
- **Offline Operation**: Works completely offline after installation
- **Verified Content**: Documentation verified during CI/CD process
### Features
- 📚 **43 Modus Web Components** documented with complete API references
- 🎨 **6 Design Rule categories** (colors, icons, spacing, typography, breakpoints, radius/stroke)
- ⚙️ **5 Setup guides** (HTML, React, themes, testing, universal rules)
- 🔧 **10 MCP tools** for comprehensive development support
- 🖥️ **Multi-IDE support** (Claude Desktop, Cursor, VS Code)
- 📱 **Secure offline operation** with bundled documentation
### Installation Options
**Option 1: NPX (Recommended)**
```json
{
"mcpServers": {
"modus-docs": {
"command": "npx",
"args": ["-y", "@julianoczkowski/mcp-modus"]
}
}
}
```
**Option 2: Global Install**
```bash
npm install -g @julianoczkowski/mcp-modus
```
### Package Stats
- 54 total documentation files (43 components + 6 rules + 5 setup)
- ~80 KB compressed
- ~350 KB unpacked
- 10 MCP tools across 3 categories
draft: false
prerelease: false