mirror of
https://github.com/cloud-shuttle/leptos-shadcn-ui.git
synced 2026-01-05 20:42:55 +00:00
Restructure as single main package: leptos-shadcn-ui with all 25 components
This commit is contained in:
58
scripts/publish_main.sh
Executable file
58
scripts/publish_main.sh
Executable file
@@ -0,0 +1,58 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Leptos ShadCN UI Main Package Publishing Script
|
||||
# This script publishes the main package that contains all components
|
||||
|
||||
set -e
|
||||
|
||||
echo "🚀 Publishing Leptos ShadCN UI Main Package"
|
||||
echo "=============================================="
|
||||
|
||||
# Navigate to the main package directory
|
||||
cd packages/leptos-shadcn-ui
|
||||
|
||||
echo "📦 Package: leptos-shadcn-ui"
|
||||
echo "📋 Version: 0.1.0"
|
||||
echo ""
|
||||
|
||||
# Check if component compiles
|
||||
echo "🔍 Checking compilation..."
|
||||
if cargo check --quiet; then
|
||||
echo " ✅ Package compiles successfully"
|
||||
|
||||
# Check with all features
|
||||
echo " 🔍 Checking with all components enabled..."
|
||||
if cargo check --features all-components --quiet; then
|
||||
echo " ✅ All components compile successfully"
|
||||
|
||||
# Publish to crates.io
|
||||
echo " 🚀 Publishing to crates.io..."
|
||||
if cargo publish --quiet; then
|
||||
echo " ✅ leptos-shadcn-ui published successfully!"
|
||||
echo ""
|
||||
echo "🎉 Main package published successfully!"
|
||||
echo ""
|
||||
echo "📋 Users can now install with:"
|
||||
echo " [dependencies]"
|
||||
echo " leptos-shadcn-ui = \"0.1.0\""
|
||||
echo ""
|
||||
echo "🔧 And use with:"
|
||||
echo " use leptos_shadcn_ui::{Button, Input, Card};"
|
||||
echo ""
|
||||
echo "✨ Or enable specific components:"
|
||||
echo " leptos-shadcn-ui = { version = \"0.1.0\", features = [\"button\", \"input\"] }"
|
||||
else
|
||||
echo " ❌ Failed to publish leptos-shadcn-ui"
|
||||
exit 1
|
||||
fi
|
||||
else
|
||||
echo " ❌ Components compilation failed"
|
||||
exit 1
|
||||
fi
|
||||
else
|
||||
echo " ❌ Package compilation failed"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo ""
|
||||
echo "✅ Main package release complete!"
|
||||
@@ -41,6 +41,21 @@ COMPONENTS=(
|
||||
echo "📦 Components to publish: ${#COMPONENTS[@]}"
|
||||
echo ""
|
||||
|
||||
# Function to check if a crate is already published
|
||||
check_if_published() {
|
||||
local package_name=$1
|
||||
local version="0.1.0"
|
||||
|
||||
# Check if the crate exists on crates.io
|
||||
if cargo search "$package_name" --limit 1 | grep -q "^$package_name"; then
|
||||
# Check if our specific version is already published
|
||||
if cargo search "$package_name" --limit 10 | grep -q "$package_name = \"$version\""; then
|
||||
return 0 # Already published
|
||||
fi
|
||||
fi
|
||||
return 1 # Not published
|
||||
}
|
||||
|
||||
# Function to publish a component
|
||||
publish_component() {
|
||||
local component=$1
|
||||
@@ -48,6 +63,12 @@ publish_component() {
|
||||
|
||||
echo "📤 Publishing ${package_name}..."
|
||||
|
||||
# Check if already published
|
||||
if check_if_published "$package_name"; then
|
||||
echo " ✅ ${package_name} is already published on crates.io - skipping"
|
||||
return 0
|
||||
fi
|
||||
|
||||
# Navigate to component directory
|
||||
cd "packages/leptos/${component}"
|
||||
|
||||
|
||||
Reference in New Issue
Block a user