-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
98 lines (80 loc) · 4.19 KB
/
Makefile
File metadata and controls
98 lines (80 loc) · 4.19 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
.PHONY: frontend-install frontend-dev frontend-build frontend-lint frontend-test backend-db backend-functions backend-lint backend-test backend-serve clean build-prod package release validate-build extension-release
SUPABASE ?= supabase
VERSION := $(shell node -p "require('./package.json').version")
DIST_DIR := dist
RELEASE_DIR := release
PACKAGE_NAME := hypermemo-$(VERSION).zip
frontend-install: ## Install front-end dependencies
pnpm install
frontend-dev: ## Start Vite dev server (Chrome extension)
pnpm run dev
frontend-build: ## Type-check and produce production build
pnpm run build
frontend-lint: ## Run Biome lint
pnpm run lint
frontend-test: ## Run Vitest suite for frontend
pnpm vitest run
backend-db: ## Apply SQL migrations to the linked Supabase project
$(SUPABASE) db push
backend-functions: ## Deploy Supabase Edge Functions
$(SUPABASE) functions deploy bookmarks summaries rag_query notes tags process-bookmark --import-map supabase/functions/deno.json --use-api
backend-lint: ## Run Deno lint on backend functions
deno lint supabase/functions
backend-test: ## Run Deno unit tests for backend helpers/functions
deno test --allow-env --allow-read supabase/functions
backend-serve: ## Serve all Edge Functions locally (with live logs)
$(SUPABASE) functions serve --import-map supabase/functions/deno.json
bump-version: ## Bump version (usage: make bump-version type=patch|minor|major)
@test -n "$(type)" || (echo "❌ Error: type argument is required. Usage: make bump-version type=patch|minor|major" && exit 1)
@echo "⬆️ Bumping $(type) version..."
@pnpm version $(type) --no-git-tag-version
@echo "✅ Version bumped to $$(node -p "require('./package.json').version")"
@echo "⚠️ Don't forget to update CHANGELOG.md!"
clean: ## Remove build artifacts and caches
rm -rf dist
rm -rf supabase/.temp
rm -rf $(RELEASE_DIR)
build-prod: clean frontend-lint ## Build production-ready extension
@echo "🏗️ Building production extension v$(VERSION)..."
@pnpm run build
@echo "✅ Production build complete!"
validate-build: ## Validate the production build
@echo "🔍 Validating build..."
@test -d $(DIST_DIR) || (echo "❌ dist/ directory not found. Run 'make build-prod' first." && exit 1)
@test -f $(DIST_DIR)/manifest.json || (echo "❌ manifest.json not found in dist/" && exit 1)
@test -f $(DIST_DIR)/pages/popup/index.html || (echo "❌ popup page not found" && exit 1)
@test -f $(DIST_DIR)/pages/dashboard/index.html || (echo "❌ dashboard page not found" && exit 1)
@echo "✅ Build validation passed!"
package: build-prod validate-build ## Package extension for Chrome Web Store
@echo "📦 Packaging extension v$(VERSION)..."
@mkdir -p $(RELEASE_DIR)
@cd $(DIST_DIR) && zip -r ../$(RELEASE_DIR)/$(PACKAGE_NAME) . -x "*.map" "*.DS_Store"
@echo "✅ Package created: $(RELEASE_DIR)/$(PACKAGE_NAME)"
@ls -lh $(RELEASE_DIR)/$(PACKAGE_NAME)
extension-release: package ## Build, validate, and package the extension for release
release: package ## Create release package and show upload instructions
@echo ""
@echo "🚀 Release package ready!"
@echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
@echo "📦 Package: $(RELEASE_DIR)/$(PACKAGE_NAME)"
@echo "📊 Version: $(VERSION)"
@echo "📏 Size: $$(du -h $(RELEASE_DIR)/$(PACKAGE_NAME) | cut -f1)"
@echo ""
@echo "📋 Next Steps:"
@echo " 1. Go to: https://chrome.google.com/webstore/devconsole"
@echo " 2. Click 'New Item' or select existing extension"
@echo " 3. Upload: $(RELEASE_DIR)/$(PACKAGE_NAME)"
@echo " 4. Fill in store listing details"
@echo " 5. Submit for review"
@echo ""
@echo "📝 Release Checklist:"
@echo " ✓ Code linted and type-checked"
@echo " ✓ Production build created"
@echo " ✓ Build validated"
@echo " ✓ Package created and ready"
@echo ""
@echo "⚠️ Remember to:"
@echo " - Update CHANGELOG.md"
@echo " - Create git tag: git tag v$(VERSION)"
@echo " - Push tag: git push origin v$(VERSION)"
@echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"