Skip to main content
Glama

Context Pods

by conorluddy
prepare-release.mjsโ€ข4.29 kB
#!/usr/bin/env node /** * Release preparation script for Context-Pods * * This script: * 1. Validates that all packages have the same version * 2. Checks that the working directory is clean * 3. Ensures we're on the main branch * 4. Verifies tests pass * 5. Provides instructions for creating a release */ import { readFileSync, existsSync } from 'fs'; import { join } from 'path'; import { execSync } from 'child_process'; const PACKAGES = [ '@context-pods/core', '@context-pods/testing', '@context-pods/server', '@context-pods/cli' ]; function getPackageVersion(packageName) { const packagePath = join(process.cwd(), 'packages', packageName.split('/')[1], 'package.json'); if (!existsSync(packagePath)) { throw new Error(`Package not found: ${packagePath}`); } const pkg = JSON.parse(readFileSync(packagePath, 'utf8')); return pkg.version; } function execCommand(command, options = {}) { try { return execSync(command, { encoding: 'utf8', stdio: 'pipe', ...options }); } catch (error) { throw new Error(`Command failed: ${command}\n${error.message}`); } } function checkGitStatus() { const status = execCommand('git status --porcelain'); if (status.trim()) { throw new Error('Working directory is not clean. Please commit or stash changes.'); } } function checkBranch() { const branch = execCommand('git branch --show-current').trim(); if (branch !== 'main') { throw new Error(`You must be on the main branch to prepare a release. Current branch: ${branch}`); } } function checkVersionConsistency() { const versions = new Map(); for (const pkg of PACKAGES) { const version = getPackageVersion(pkg); versions.set(pkg, version); } const uniqueVersions = new Set(versions.values()); if (uniqueVersions.size > 1) { console.error('โŒ Package versions are not consistent:'); for (const [pkg, version] of versions) { console.error(` ${pkg}: ${version}`); } throw new Error('All packages must have the same version before release'); } return Array.from(uniqueVersions)[0]; } async function main() { console.log('๐Ÿš€ Preparing Context-Pods for release...\n'); try { // Check git status console.log('๐Ÿ“‹ Checking git status...'); checkGitStatus(); console.log('โœ… Working directory is clean\n'); // Check branch console.log('๐ŸŒฟ Checking branch...'); checkBranch(); console.log('โœ… On main branch\n'); // Check version consistency console.log('๐Ÿ”ข Checking package versions...'); const currentVersion = checkVersionConsistency(); console.log(`โœ… All packages at version: ${currentVersion}\n`); // Pull latest changes console.log('๐Ÿ“ฅ Pulling latest changes...'); execCommand('git pull origin main'); console.log('โœ… Up to date with origin/main\n'); // Run tests console.log('๐Ÿงช Running tests...'); execCommand('npm test', { stdio: 'inherit' }); console.log('โœ… All tests passed\n'); // Build packages console.log('๐Ÿ”จ Building packages...'); execCommand('npm run build', { stdio: 'inherit' }); console.log('โœ… Build successful\n'); console.log('โœจ Release preparation complete!\n'); console.log('๐Ÿ“ Next steps:'); console.log(` 1. Decide on the new version number (current: ${currentVersion})`); console.log(' 2. Update all package versions:'); console.log(' npm run release:version -- <new-version>'); console.log(' 3. Commit the version changes:'); console.log(' git add . && git commit -m "chore: bump version to <new-version>"'); console.log(' 4. Push to main:'); console.log(' git push origin main'); console.log(' 5. Create a GitHub release:'); console.log(' - Go to https://github.com/conorluddy/ContextPods/releases/new'); console.log(' - Create a new tag: v<new-version>'); console.log(' - Target: main'); console.log(' - Write release notes'); console.log(' - Publish release\n'); console.log('The GitHub Actions workflow will automatically publish to npm! ๐ŸŽ‰'); } catch (error) { console.error(`\nโŒ Error: ${error.message}`); process.exit(1); } } main().catch(console.error);

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/conorluddy/ContextPods'

If you have feedback or need assistance with the MCP directory API, please join our Discord server