Initial commit: add .gitignore and README
This commit is contained in:
39
scripts/publish.sh
Executable file
39
scripts/publish.sh
Executable file
@@ -0,0 +1,39 @@
|
||||
#!/bin/bash
|
||||
# Publish shared packages to private npm registry
|
||||
|
||||
set -e
|
||||
|
||||
REGISTRY="${NPM_REGISTRY:-http://localhost:4873}"
|
||||
SCOPE="@workspace"
|
||||
|
||||
echo "📦 Publishing shared packages to registry: $REGISTRY"
|
||||
|
||||
# Check if registry is accessible
|
||||
if ! curl -s "$REGISTRY" > /dev/null; then
|
||||
echo "❌ Registry not accessible at $REGISTRY"
|
||||
echo " Please ensure registry is running or set NPM_REGISTRY environment variable"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Publish each package
|
||||
for package in packages/*/; do
|
||||
if [ -f "$package/package.json" ]; then
|
||||
package_name=$(basename "$package")
|
||||
echo "📤 Publishing $package_name..."
|
||||
|
||||
cd "$package"
|
||||
|
||||
# Build package
|
||||
pnpm build
|
||||
|
||||
# Publish
|
||||
npm publish --registry="$REGISTRY" --access restricted || {
|
||||
echo "⚠️ Failed to publish $package_name (may already be published)"
|
||||
}
|
||||
|
||||
cd - > /dev/null
|
||||
fi
|
||||
done
|
||||
|
||||
echo "✅ Publishing complete!"
|
||||
|
||||
Reference in New Issue
Block a user