@chaim-tools/chaim 0.1.5 → 0.1.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,47 +1,41 @@
1
1
  #!/bin/bash
2
2
 
3
- echo "🚀 Setting up Chaim CLI (TypeScript)"
3
+ set -e
4
+
5
+ SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"
6
+ PROJECT_ROOT="$(cd "$SCRIPT_DIR/../.." && pwd)"
7
+
8
+ echo "Setting up Chaim CLI (TypeScript)"
9
+ echo ""
4
10
 
5
11
  # Check if Node.js is installed
6
12
  if ! command -v node &> /dev/null; then
7
- echo " Node.js is not installed. Please install Node.js v18 or higher."
13
+ echo "ERROR: Node.js is not installed. Please install Node.js v18 or higher."
8
14
  exit 1
9
15
  fi
10
16
 
11
17
  # Check Node.js version
12
18
  NODE_VERSION=$(node -v | cut -d'v' -f2 | cut -d'.' -f1)
13
19
  if [ "$NODE_VERSION" -lt 18 ]; then
14
- echo " Node.js version 18 or higher is required. Current version: $(node -v)"
20
+ echo "ERROR: Node.js version 18 or higher is required. Current version: $(node -v)"
15
21
  exit 1
16
22
  fi
17
23
 
18
- echo "Node.js version: $(node -v)"
24
+ echo "Node.js version: $(node -v) OK"
19
25
 
20
26
  # Install dependencies
21
- echo "📦 Installing CLI dependencies..."
22
- cd cli && npm install
27
+ echo "Installing dependencies..."
28
+ cd "$PROJECT_ROOT"
29
+ npm install
23
30
 
24
31
  # Build the TypeScript CLI
25
- echo "🔨 Building TypeScript CLI..."
26
- npm run build
27
-
28
- # Build Java modules (for code generation)
29
- echo "☕ Building Java modules..."
30
- cd ../java
31
- if [ -f "gradlew" ]; then
32
- ./gradlew :schema-core:build
33
- ./gradlew :codegen-java:build
34
- ./gradlew :cdk-integration:build
35
- else
36
- echo "⚠️ Gradle wrapper not found. Please install Gradle and run:"
37
- echo " gradle :schema-core:build"
38
- echo " gradle :codegen-java:build"
39
- echo " gradle :cdk-integration:build"
40
- fi
32
+ echo "Building TypeScript CLI..."
33
+ npx tsc
41
34
 
42
- echo "✅ Setup complete!"
35
+ echo ""
36
+ echo "Setup complete!"
43
37
  echo ""
44
38
  echo "Usage:"
45
- echo " ./cli/dist/index.js generate --stack MyStack --package com.example"
46
- echo " ./cli/dist/index.js validate ./shared/examples/user.bprint"
47
- echo " ./cli/dist/index.js doctor"
39
+ echo " npx chaim generate --stack MyStack --package com.example"
40
+ echo " npx chaim validate ./schemas/user.bprint"
41
+ echo " npx chaim doctor"