#!/bin/bash

# Build and publish the npm package
cd npm-package

# Install dependencies
echo "📦 Installing dependencies..."
npm install

# Build the package
echo "🔨 Building the package..."
npm run build

# Pack the package locally
echo "📦 Creating npm package..."
npm pack

# Publish to npm
echo "🚀 Publishing to npm..."
npm publish

echo "✅ Package published successfully!"
echo "📦 Package name: realtimecursor"
echo "📦 Version: $(node -p "require('./package.json').version")"