-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
134 lines (113 loc) · 3.84 KB
/
Copy pathMakefile
File metadata and controls
134 lines (113 loc) · 3.84 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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
.PHONY: run deps build clean test lint format help dev
# Default target
run: deps
@echo "Starting frontend framework development environment with devloop..."
devloop -c .devloop.yaml
# Install all dependencies
deps:
@echo "Installing dependencies for all workspaces..."
@if ! command -v node >/dev/null 2>&1; then \
echo "Error: Node.js is not installed"; \
exit 1; \
fi
@echo "Installing root dependencies..."
npm install
@echo "Installing workspace dependencies..."
npm run install:all
@echo "All dependencies installed successfully!"
# Development without devloop
dev:
@echo "Starting all development servers manually..."
@echo "This will start React, Vue, and Storybook in parallel"
npm run dev
# Build all projects
build:
@echo "Building all projects..."
npm run build:all
@echo "All projects built successfully!"
# Clean all build artifacts and dependencies
clean:
@echo "Cleaning all build artifacts and dependencies..."
rm -rf node_modules
rm -rf react-app/{node_modules,dist,build}
rm -rf vue-components/{node_modules,dist}
rm -rf storybook/{node_modules,storybook-static}
rm -rf shared/node_modules
rm -rf logs
@echo "Clean completed!"
# Run all tests
test:
@echo "Running all tests..."
npm run test:all
@echo "All tests completed!"
# Run linting
lint:
@echo "Running linters..."
npm run lint:all
@echo "Linting completed!"
# Format all code
format:
@echo "Formatting all code..."
npm run format:all
@echo "Formatting completed!"
# Type check all TypeScript
type-check:
@echo "Running TypeScript type checking..."
npm run type-check:all
@echo "Type checking completed!"
# Install specific workspace
install-react:
cd react-app && npm install
install-vue:
cd vue-components && npm install
install-storybook:
cd storybook && npm install
install-shared:
cd shared && npm install
# Build specific projects
build-react:
cd react-app && npm run build
build-vue:
cd vue-components && npm run build
build-storybook:
cd storybook && npm run build
# Development for specific projects
dev-react:
cd react-app && npm run dev
dev-vue:
cd vue-components && npm run dev
dev-storybook:
cd storybook && npm run dev
# Check project health
health:
@echo "Checking project health..."
@echo "Node version: $(shell node --version)"
@echo "NPM version: $(shell npm --version)"
@echo "Checking package.json files..."
@find . -name "package.json" -not -path "*/node_modules/*" | wc -l | xargs echo "Found package.json files:"
@echo "Checking for common issues..."
@if [ ! -d "node_modules" ]; then echo "⚠️ Root node_modules missing - run 'make deps'"; fi
@if [ ! -d "react-app/node_modules" ]; then echo "⚠️ React app dependencies missing"; fi
@if [ ! -d "vue-components/node_modules" ]; then echo "⚠️ Vue components dependencies missing"; fi
@if [ ! -d "storybook/node_modules" ]; then echo "⚠️ Storybook dependencies missing"; fi
@echo "Health check completed!"
# Show help
help:
@echo "Available commands:"
@echo " make run - Start development environment with devloop"
@echo " make deps - Install all dependencies"
@echo " make dev - Start all dev servers manually (without devloop)"
@echo " make build - Build all projects"
@echo " make clean - Clean all build artifacts and dependencies"
@echo " make test - Run all tests"
@echo " make lint - Run all linters"
@echo " make format - Format all code"
@echo " make type-check - Run TypeScript type checking"
@echo " make health - Check project health"
@echo ""
@echo "Workspace-specific commands:"
@echo " make install-{react,vue,storybook,shared} - Install specific workspace deps"
@echo " make build-{react,vue,storybook} - Build specific project"
@echo " make dev-{react,vue,storybook} - Start specific dev server"
@echo ""
@echo " make help - Show this help message"