Skip to content
Merged
Show file tree
Hide file tree
Changes from all 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
2 changes: 1 addition & 1 deletion .cursor/mcp.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"corates": {
"type": "stdio",
"command": "node",
"args": ["/Users/jacobmaynard/Documents/Repos/corates/packages/mcp/server.js"],
"args": ["/Users/jacobmaynard/Documents/Repos/corates/packages/mcp/dist/server.js"],
"env": {}
},
"ark-ui": {
Expand Down
202 changes: 202 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,202 @@
version: 2
updates:
# Root package.json dependencies
- package-ecosystem: 'npm'
directory: '/'
schedule:
interval: 'weekly'
day: 'monday'
time: '09:00'
open-pull-requests-limit: 5
labels:
- 'dependencies'
- 'root'
versioning-strategy: increase
commit-message:
prefix: 'chore'
prefix-development: 'chore'
include: 'scope'
rebase-strategy: 'auto'
groups:
root-dev-dependencies:
patterns:
- '*'
dependency-type: 'development'

# Landing package
- package-ecosystem: 'npm'
directory: '/packages/landing'
schedule:
interval: 'weekly'
day: 'monday'
time: '09:00'
open-pull-requests-limit: 3
labels:
- 'dependencies'
- 'landing'
versioning-strategy: increase
commit-message:
prefix: 'chore'
prefix-development: 'chore'
include: 'scope'
rebase-strategy: 'auto'
groups:
landing-dependencies:
patterns:
- '*'
dependency-type: 'production'
landing-dev-dependencies:
patterns:
- '*'
dependency-type: 'development'

# MCP package
- package-ecosystem: 'npm'
directory: '/packages/mcp'
schedule:
interval: 'weekly'
day: 'monday'
time: '09:00'
open-pull-requests-limit: 3
labels:
- 'dependencies'
- 'mcp'
versioning-strategy: increase
commit-message:
prefix: 'chore'
prefix-development: 'chore'
include: 'scope'
rebase-strategy: 'auto'
groups:
mcp-dependencies:
patterns:
- '*'
dependency-type: 'production'
mcp-dev-dependencies:
patterns:
- '*'
dependency-type: 'development'

# Shared package
- package-ecosystem: 'npm'
directory: '/packages/shared'
schedule:
interval: 'weekly'
day: 'monday'
time: '09:00'
open-pull-requests-limit: 3
labels:
- 'dependencies'
- 'shared'
versioning-strategy: increase
commit-message:
prefix: 'chore'
prefix-development: 'chore'
include: 'scope'
rebase-strategy: 'auto'
groups:
shared-dependencies:
patterns:
- '*'
dependency-type: 'production'
shared-dev-dependencies:
patterns:
- '*'
dependency-type: 'development'

# UI package
- package-ecosystem: 'npm'
directory: '/packages/ui'
schedule:
interval: 'weekly'
day: 'monday'
time: '09:00'
open-pull-requests-limit: 3
labels:
- 'dependencies'
- 'ui'
versioning-strategy: increase
commit-message:
prefix: 'chore'
prefix-development: 'chore'
include: 'scope'
rebase-strategy: 'auto'
groups:
ui-dependencies:
patterns:
- '*'
dependency-type: 'production'
ui-dev-dependencies:
patterns:
- '*'
dependency-type: 'development'

# Web package
- package-ecosystem: 'npm'
directory: '/packages/web'
schedule:
interval: 'weekly'
day: 'monday'
time: '09:00'
open-pull-requests-limit: 5
labels:
- 'dependencies'
- 'web'
versioning-strategy: increase
commit-message:
prefix: 'chore'
prefix-development: 'chore'
include: 'scope'
rebase-strategy: 'auto'
groups:
web-dependencies:
patterns:
- '*'
dependency-type: 'production'
web-dev-dependencies:
patterns:
- '*'
dependency-type: 'development'

# Workers package
- package-ecosystem: 'npm'
directory: '/packages/workers'
schedule:
interval: 'weekly'
day: 'monday'
time: '09:00'
open-pull-requests-limit: 5
labels:
- 'dependencies'
- 'workers'
versioning-strategy: increase
commit-message:
prefix: 'chore'
prefix-development: 'chore'
include: 'scope'
rebase-strategy: 'auto'
groups:
workers-dependencies:
patterns:
- '*'
dependency-type: 'production'
workers-dev-dependencies:
patterns:
- '*'
dependency-type: 'development'

# GitHub Actions workflows
- package-ecosystem: 'github-actions'
directory: '/'
schedule:
interval: 'weekly'
day: 'monday'
time: '09:00'
open-pull-requests-limit: 2
labels:
- 'dependencies'
- 'github-actions'
commit-message:
prefix: 'ci'
include: 'scope'
rebase-strategy: 'auto'
2 changes: 0 additions & 2 deletions .github/workflows/prettier.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,6 @@ jobs:

- name: Setup pnpm
uses: pnpm/action-setup@v4
with:
version: 10

- name: Setup Node.js
uses: actions/setup-node@v4
Expand Down
2 changes: 1 addition & 1 deletion .vscode/mcp.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"corates": {
"type": "stdio",
"command": "node",
"args": ["${workspaceFolder}/packages/mcp/server.js"]
"args": ["${workspaceFolder}/packages/mcp/dist/server.js"]
}
// "stripe": {
// "type": "http",
Expand Down
5 changes: 4 additions & 1 deletion packages/mcp/.gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
dist/
node_modules/
*.tsbuildinfo
zag-docs
icon-manifest.json
zag-manifest.json
zag-manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ import { fileURLToPath } from 'url';
const __filename = fileURLToPath(import.meta.url);
const __dirname = path.dirname(__filename);

interface IconManifest {
[library: string]: string[];
}

describe('icons tool', () => {
it('should have icon manifest file', async () => {
const manifestPath = path.join(__dirname, '..', 'icon-manifest.json');
Expand All @@ -16,7 +20,7 @@ describe('icons tool', () => {
it('should load valid icon manifest', async () => {
const manifestPath = path.join(__dirname, '..', 'icon-manifest.json');
const content = await fs.readFile(manifestPath, 'utf8');
const manifest = JSON.parse(content);
const manifest = JSON.parse(content) as IconManifest;

expect(typeof manifest).toBe('object');
expect(Object.keys(manifest).length).toBeGreaterThan(0);
Expand All @@ -32,7 +36,7 @@ describe('icons tool', () => {
it('should have common icon libraries', async () => {
const manifestPath = path.join(__dirname, '..', 'icon-manifest.json');
const content = await fs.readFile(manifestPath, 'utf8');
const manifest = JSON.parse(content);
const manifest = JSON.parse(content) as IconManifest;

// Check for common libraries
expect(manifest).toHaveProperty('fa'); // Font Awesome
Expand Down
File renamed without changes.
1 change: 0 additions & 1 deletion packages/mcp/constants.js

This file was deleted.

12 changes: 9 additions & 3 deletions packages/mcp/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,15 @@
"type": "module",
"license": "PolyForm-Noncommercial-1.0.0",
"bin": {
"corates-mcp": "./server.js"
"corates-mcp": "./dist/server.js"
},
"scripts": {
"start": "nohup node server.js > /dev/null 2>&1 & echo 'MCP server started in background'",
"build": "tsc",
"dev": "tsc --watch",
"clean": "rm -rf dist",
"start": "nohup node dist/server.js > /dev/null 2>&1 & echo 'MCP server started in background'",
"stop": "pkill -f 'node.*server.js' || echo 'No MCP server running'",
"scrape": "node scrape-icons.js",
"scrape": "tsx src/scrape-icons.ts",
"test": "vitest run",
"test:watch": "vitest"
},
Expand All @@ -18,6 +21,9 @@
"zod": "^4.2.1"
},
"devDependencies": {
"@types/node": "^22.10.1",
"tsx": "^4.19.2",
"typescript": "^5.9.3",
"vitest": "^3.2.4"
}
}
1 change: 1 addition & 0 deletions packages/mcp/src/constants.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export const CACHE_TTL: number = 24 * 60 * 60 * 1000; // 24 hours
27 changes: 16 additions & 11 deletions packages/mcp/scrape-icons.js → packages/mcp/src/scrape-icons.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
// scripts/scrape-icons.js
// Generates a manifest of all available icons from solid-icons
// Parses the index.js files directly since Node can't import JSX
import fs from 'fs/promises';
Expand All @@ -8,8 +7,12 @@ import { fileURLToPath } from 'url';
const __filename = fileURLToPath(import.meta.url);
const __dirname = path.dirname(__filename);

interface IconManifest {
[library: string]: string[];
}

// All icon set abbreviations in solid-icons
const iconSets = [
const iconSets: readonly string[] = [
'ai',
'bi',
'bs',
Expand All @@ -26,15 +29,16 @@ const iconSets = [
'ti',
'vs',
'wi',
];
] as const;

async function getIconsFromSet(setAbbr) {
async function getIconsFromSet(setAbbr: string): Promise<string[]> {
try {
// Read the index.js file and extract function export names
// (Node can't import JSX files directly)
const indexPath = path.join(
__dirname,
'..',
'..',
'web',
'node_modules',
'solid-icons',
Expand All @@ -45,22 +49,23 @@ async function getIconsFromSet(setAbbr) {

// Match: export function IconName(props)
const exportRegex = /export\s+function\s+([A-Z][a-zA-Z0-9]*)\s*\(/g;
const icons = [];
let match;
const icons: string[] = [];
let match: RegExpExecArray | null;

while ((match = exportRegex.exec(content)) !== null) {
icons.push(match[1]);
}

return icons;
} catch (err) {
console.warn(`Could not read solid-icons/${setAbbr}: ${err.message}`);
const errorMessage = err instanceof Error ? err.message : String(err);
console.warn(`Could not read solid-icons/${setAbbr}: ${errorMessage}`);
return [];
}
}

async function main() {
const manifest = {};
async function main(): Promise<void> {
const manifest: IconManifest = {};
let totalIcons = 0;

for (const setAbbr of iconSets) {
Expand All @@ -71,13 +76,13 @@ async function main() {
console.log(` Found ${icons.length} icons`);
}

const outFile = path.join(__dirname, 'icon-manifest.json');
const outFile = path.join(__dirname, '..', 'icon-manifest.json');
await fs.writeFile(outFile, JSON.stringify(manifest, null, 2), 'utf8');
console.log(`\nTotal: ${totalIcons} icons`);
console.log(`Manifest written to ${outFile}`);
}

main().catch(err => {
main().catch((err: unknown) => {
console.error(err);
process.exit(1);
});
Loading