-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
128 lines (109 loc) · 6.9 KB
/
Makefile
File metadata and controls
128 lines (109 loc) · 6.9 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
# Numix VS Code Theme - Makefile
# Variables
PACKAGE = numix-vscode-theme
VERSION := $(shell node -p "require('./package.json').version")
VSIX_FILE = $(PACKAGE)-$(VERSION).vsix
# Numix Colors (24-bit terminal colors)
RED := $(shell echo -e '\033[38;2;240;84;76m')
GREEN := $(shell echo -e '\033[38;2;129;199;132m')
BLUE := $(shell echo -e '\033[38;2;100;181;246m')
YELLOW := $(shell echo -e '\033[38;2;255;183;77m')
PURPLE := $(shell echo -e '\033[38;2;186;104;200m')
CYAN := $(shell echo -e '\033[38;2;77;182;172m')
WHITE := $(shell echo -e '\033[38;2;232;232;232m')
NC := $(shell echo -e '\033[0m')
# Icons
CHECK = [*]
CROSS = [X]
ARROW = -->
.PHONY: all install validate package publish release bump bump-major bump-minor bump-patch help open status clean test
all: help
install:
@printf "%s%s%s%s\n" "$(BLUE)" "$(ARROW)" " Install dependencies" "$(NC)"
@npm install -g @vscode/vsce 2>/dev/null || true
@printf "%s%s%s%s\n" "$(GREEN)" "$(CHECK)" " Dependencies ready" "$(NC)"
validate: install
@printf "%s%s%s%s\n" "$(BLUE)" "$(ARROW)" " Validating extension..." "$(NC)"
@vsce validate --package
@printf "%s%s%s%s\n" "$(GREEN)" "$(CHECK)" " Validation passed" "$(NC)"
package: validate
@printf "%s%s%s%s\n" "$(BLUE)" "$(ARROW)" " Packaging extension..." "$(NC)"
@vsce package --allow-missing-repository
@printf "%s%s%s %s%s\n" "$(GREEN)" "$(CHECK)" " Created" "$(VSIX_FILE)" "$(NC)"
publish: package
@printf "%s%s%s%s\n" "$(BLUE)" "$(ARROW)" " Publishing to Marketplace..." "$(NC)"
@vsce publish --pat "$(VSCE_TOKEN)"
@printf "%s%s%s%s\n" "$(GREEN)" "$(CHECK)" " Published!" "$(NC)"
release: package publish
@printf "%s%s%s%s\n" "$(GREEN)" "$(CHECK)" " Release complete!" "$(NC)"
bump-major:
@printf "%s%s%s%s\n" "$(BLUE)" "$(ARROW)" " Bumping major version..." "$(NC)"
@npm version major
@git push --tags
@printf "%s%s%s %s%s\n" "$(GREEN)" "$(CHECK)" " Version bumped to" "$(shell npm version --json | grep '"version"' | cut -d'"' -f4)" "$(NC)"
bump-minor:
@printf "%s%s%s%s\n" "$(BLUE)" "$(ARROW)" " Bumping minor version..." "$(NC)"
@npm version minor
@git push --tags
@printf "%s%s%s %s%s\n" "$(GREEN)" "$(CHECK)" " Version bumped to" "$(shell npm version --json | grep '"version"' | cut -d'"' -f4)" "$(NC)"
bump-patch:
@printf "%s%s%s%s\n" "$(BLUE)" "$(ARROW)" " Bumping patch version..." "$(NC)"
@npm version patch
@git push --tags
@printf "%s%s%s %s%s\n" "$(GREEN)" "$(CHECK)" " Version bumped to" "$(shell npm version --json | grep '"version"' | cut -d'"' -f4)" "$(NC)"
bump: bump-patch
@printf "%s%s%s%s\n" "$(YELLOW)" "$(ARROW)" " Available: make bump-major | bump-minor | bump-patch" "$(NC)"
test:
@printf "%s%s%s%s\n" "$(BLUE)" "$(ARROW)" " Running tests..." "$(NC)"
@echo "Checking files..."
@test -f numix-theme.json && printf "%s%s%s%s\n" "$(GREEN)" "$(CHECK)" " numix-theme.json" "$(NC)" || printf "%s%s%s%s\n" "$(RED)" "$(CROSS)" " numix-theme.json missing" "$(NC)"
@test -f package.json && printf "%s%s%s%s\n" "$(GREEN)" "$(CHECK)" " package.json" "$(NC)" || printf "%s%s%s%s\n" "$(RED)" "$(CROSS)" " package.json missing" "$(NC)"
@test -f LICENSE && printf "%s%s%s%s\n" "$(GREEN)" "$(CHECK)" " LICENSE" "$(NC)" || printf "%s%s%s%s\n" "$(RED)" "$(CROSS)" " LICENSE missing" "$(NC)"
@test -f README.md && printf "%s%s%s%s\n" "$(GREEN)" "$(CHECK)" " README.md" "$(NC)" || printf "%s%s%s%s\n" "$(RED)" "$(CROSS)" " README.md missing" "$(NC)"
@test -d .github/workflows && printf "%s%s%s%s\n" "$(GREEN)" "$(CHECK)" " .github/workflows" "$(NC)" || printf "%s%s%s%s\n" "$(RED)" "$(CROSS)" " .github/workflows missing" "$(NC)"
@printf "%s%s%s%s\n" "$(GREEN)" "$(CHECK)" " Tests passed" "$(NC)"
open:
@printf "%s%s%s%s\n" "$(BLUE)" "$(ARROW)" " Opening in VS Code..." "$(NC)"
@code .
status:
@printf "%s%s%s%s\n" "$(BLUE)" "$(ARROW)" " Project Status" "$(NC)"
@echo "---------------------------------"
@test -f numix-theme.json && printf "Theme file: %s%s%s%s\n" "$(GREEN)" "$(CHECK)" " numix-theme.json" "$(NC)" || printf "Theme file: %s%s%s%s\n" "$(RED)" "$(CROSS)" " numix-theme.json" "$(NC)"
@test -f package.json && printf "Package.json: %s%s%s%s\n" "$(GREEN)" "$(CHECK)" " package.json" "$(NC)" || printf "Package.json: %s%s%s%s\n" "$(RED)" "$(CROSS)" " package.json" "$(NC)"
@test -f LICENSE && printf "License: %s%s%s%s\n" "$(GREEN)" "$(CHECK)" " LICENSE" "$(NC)" || printf "License: %s%s%s%s\n" "$(RED)" "$(CROSS)" " LICENSE missing" "$(NC)"
@test -f README.md && printf "README: %s%s%s%s\n" "$(GREEN)" "$(CHECK)" " README.md" "$(NC)" || printf "README: %s%s%s%s\n" "$(RED)" "$(CROSS)" " README.md missing" "$(NC)"
@test -d .github/workflows && printf "GitHub Actions: %s%s%s%s\n" "$(GREEN)" "$(CHECK)" " .github/workflows" "$(NC)" || printf "GitHub Actions: %s%s%s%s\n" "$(RED)" "$(CROSS)" " .github/workflows" "$(NC)"
@echo ""
@echo "Version: $(VERSION)"
clean:
@printf "%s%s%s%s\n" "$(BLUE)" "$(ARROW)" " Cleaning build artifacts..." "$(NC)"
@rm -f *.vsix
@printf "%s%s%s%s\n" "$(GREEN)" "$(CHECK)" " Cleaned" "$(NC)"
help:
@printf "%s%s%s%s\n" "$(CYAN)" "" "Numix VS Code Theme - Build System" "$(NC)"
@echo ""
@echo "Usage: make [command]"
@echo ""
@echo "Commands:"
@printf " %s%-11s%s %s%s%s\n" "$(BLUE)" "install" "$(NC)" "$(WHITE)" "Install dependencies" "$(NC)"
@printf " %s%-11s%s %s%s%s\n" "$(BLUE)" "validate" "$(NC)" "$(WHITE)" "Validate extension manifest" "$(NC)"
@printf " %s%-11s%s %s%s%s\n" "$(BLUE)" "package" "$(NC)" "$(WHITE)" "Create .vsix package" "$(NC)"
@printf " %s%-11s%s %s%s%s\n" "$(BLUE)" "publish" "$(NC)" "$(WHITE)" "Publish to VS Code Marketplace" "$(NC)"
@printf " %s%-11s%s %s%s%s\n" "$(GREEN)" "release" "$(NC)" "$(WHITE)" "Full release (package + publish)" "$(NC)"
@printf " %s%-11s%s %s%s%s\n" "$(YELLOW)" "bump" "$(NC)" "$(WHITE)" "Bump patch version" "$(NC)"
@printf " %s%-11s%s %s%s%s\n" "$(YELLOW)" "bump-major" "$(NC)" "$(WHITE)" "Bump major version" "$(NC)"
@printf " %s%-11s%s %s%s%s\n" "$(YELLOW)" "bump-minor" "$(NC)" "$(WHITE)" "Bump minor version" "$(NC)"
@printf " %s%-11s%s %s%s%s\n" "$(YELLOW)" "bump-patch" "$(NC)" "$(WHITE)" "Bump patch version" "$(NC)"
@printf " %s%-11s%s %s%s%s\n" "$(PURPLE)" "test" "$(NC)" "$(WHITE)" "Run project tests" "$(NC)"
@printf " %s%-11s%s %s%s%s\n" "$(BLUE)" "open" "$(NC)" "$(WHITE)" "Open in VS Code" "$(NC)"
@printf " %s%-11s%s %s%s%s\n" "$(CYAN)" "status" "$(NC)" "$(WHITE)" "Show project status" "$(NC)"
@printf " %s%-11s%s %s%s%s\n" "$(RED)" "clean" "$(NC)" "$(WHITE)" "Remove build artifacts" "$(NC)"
@printf " %s%-11s%s %s%s%s\n" "$(WHITE)" "help" "$(NC)" "$(WHITE)" "Show this help" "$(NC)"
@echo ""
@echo "Environment:"
@printf " %s%-11s%s %s%s%s\n" "$(WHITE)" "VSCE_TOKEN" "$(NC)" "$(WHITE)" "Personal Access Token for publishing" "$(NC)"
@echo ""
@echo "Examples:"
@printf " %s%s%s\n" "$(CYAN)" "make package" "$(NC)"
@printf " %s%s\n" "$(CYAN)" "VSCE_TOKEN=xxx make publish" "$(NC)"
@printf " %s%s\n" "$(CYAN)" "make release VSCE_TOKEN=xxx" "$(NC)"