-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgenerate_samples.sh
More file actions
executable file
·63 lines (49 loc) · 1.45 KB
/
Copy pathgenerate_samples.sh
File metadata and controls
executable file
·63 lines (49 loc) · 1.45 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
#!/bin/bash
# Script to generate sample code using local ercode_cli
echo "🚀 Generating sample code with Ercode CLI..."
echo ""
# Create temporary test directory structure
TEST_DIR="examples/generated"
mkdir -p $TEST_DIR/lib/modules
mkdir -p $TEST_DIR/lib/helpers
# Copy configs
mkdir -p $TEST_DIR/generator
cp examples/configs/*.json $TEST_DIR/generator/
# Navigate to test directory
cd $TEST_DIR
# Create dummy pubspec.yaml for the generator to read
cat > pubspec.yaml << 'EOF'
name: sample_app
description: Sample generated app
version: 1.0.0
environment:
sdk: ">=2.18.6 <3.0.0"
dependencies:
flutter:
sdk: flutter
dio: ^4.0.6
flutter_bloc: ^8.1.3
hive: ^2.2.3
hive_flutter: ^1.1.0
EOF
# Create dummy main.dart
mkdir -p lib
touch lib/main.dart
cd ../..
echo "📝 Generating Product module (Cubit + Offline-First)..."
dart bin/ercode_cli.dart generate $TEST_DIR/generator/product.json
echo ""
echo "📝 Generating Article module (Cubit + Offline-First)..."
dart bin/ercode_cli.dart generate $TEST_DIR/generator/article.json
echo ""
echo "📝 Generating Note module (StatefulWidget - traditional)..."
dart bin/ercode_cli.dart generate $TEST_DIR/generator/note_simple.json
echo ""
echo "✅ Sample code generated!"
echo ""
echo "📁 Check generated files in: examples/generated/lib/modules/"
echo ""
echo "Generated modules:"
echo " - product/ (Cubit + Offline-First)"
echo " - article/ (Cubit + Offline-First)"
echo " - note/ (StatefulWidget)"