UNPKG

sqlite-mcp-server

Version:

SQLite MCP Server - A Model Context Protocol server for SQLite database operations

57 lines (48 loc) 1.8 kB
#!/usr/bin/env node const fs = require('fs'); const path = require('path'); console.log('Preparing package for npm publish...'); // 复制README.npm.md为README.md用于npm发布 const npmReadmePath = path.join(__dirname, '..', 'README.npm.md'); const readmePath = path.join(__dirname, '..', 'README.md'); if (fs.existsSync(npmReadmePath)) { console.log('Copying README.npm.md to README.md for npm publish...'); fs.copyFileSync(npmReadmePath, readmePath); console.log('✓ README.md updated for npm publish'); } else { console.log('⚠️ README.npm.md not found, using existing README.md'); } // 检查必要文件是否存在 const requiredFiles = [ 'package.json', 'bin/sqlite-mcp-server.js', 'scripts/install-python-deps.js', 'python/sqlite.py', 'python/log.py', 'python/requirements.txt' ]; console.log('\nChecking required files...'); let allFilesExist = true; requiredFiles.forEach(file => { const filePath = path.join(__dirname, '..', file); if (fs.existsSync(filePath)) { console.log(`✓ ${file}`); } else { console.log(`✗ ${file} - MISSING!`); allFilesExist = false; } }); if (allFilesExist) { console.log('\n✓ All required files are present'); console.log('\nReady to publish! Run:'); console.log('npm publish'); } else { console.log('\n✗ Some required files are missing. Please fix before publishing.'); process.exit(1); } console.log('\nPackage contents that will be published:'); console.log('- bin/sqlite-mcp-server.js (Node.js wrapper)'); console.log('- scripts/install-python-deps.js (Post-install script)'); console.log('- python/ (Python MCP server and dependencies)'); console.log('- README.md (Documentation)'); console.log('- package.json (Package metadata)');