-
Notifications
You must be signed in to change notification settings - Fork 10
Expand file tree
/
Copy pathmakefile
More file actions
72 lines (59 loc) · 1.69 KB
/
makefile
File metadata and controls
72 lines (59 loc) · 1.69 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
# Node.js related commands
.PHONY: install test dev clean build run-ts
# Default target
all: install
# Install dependencies
install:
npm install
# Install dependencies for production only
install-prod:
npm install --production
# Run tests
test:
npm test
# Clean up
clean:
rm -rf node_modules
rm -rf dist
rm -rf coverage
# Development mode
dev:
npm run dev
# Build the project
build:
npm run build
# Type checking with TypeScript
type-check:
npx tsc --noEmit
# Run in production mode
start:
npm start
# Install a new package
install-package:
@read -p "Enter package name: " package; \
npm install $$package
# Install a new development package
install-dev-package:
@read -p "Enter package name: " package; \
npm install --save-dev $$package
# Run TypeScript file with ts-node
run-ts:
@if [ -z "$(file)" ]; then \
echo "Please specify a file: make run-ts file=your-file.ts"; \
else \
npx ts-node $(file); \
fi
# Help command
help:
@echo "Available commands:"
@echo " make install - Install all dependencies"
@echo " make install-prod - Install production dependencies only"
@echo " make test - Run tests"
@echo " make clean - Remove node_modules, dist, and coverage directories"
@echo " make dev - Run in development mode"
@echo " make build - Build the project"
@echo " make type-check - Run TypeScript type checking"
@echo " make start - Start in production mode"
@echo " make install-package - Install a new package (will prompt for name)"
@echo " make install-dev-package - Install a new dev package (will prompt for name)"
@echo " make run-ts file=<filename> - Run a TypeScript file using ts-node"