forked from aergic-labs/artizo
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
129 lines (104 loc) · 5.33 KB
/
Copy pathMakefile
File metadata and controls
129 lines (104 loc) · 5.33 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
# Artizo — local development and release automation
# =================================================
#
# ── Boundary ───────────────────────────────────────────────────
# package.json scripts = atomic, single-tool commands (tsc, vitest, esbuild, knip)
# Makefile = orchestration (pipelines, release, cleanup, setup)
#
# Always prefer npm scripts directly during development:
# npm test Fast feedback (unit + property, no Docker)
# npm run test:coverage Coverage report (unit + property)
# npm run test:all Everything (unit + property + integration)
# npm run lint Type-check + dead-code detection
# npm run build esbuild bundle only (no VSIX)
# npm run package:kiro Build a single VSIX for Kiro
#
# Makefile targets:
# make setup Explicit one-time setup (also runs automatically when needed)
# make check Full quality gate (lint + test:all)
# make build Build all three platform VSIX files
# make release VERSION=x.y.z Bump version, check, build, tag
# make publish Publish all three VSIX files to Open VSX
# make clean Remove build artifacts (safe, no re-setup needed)
# make distclean Nuclear clean (auto-recovers on next make)
#
# Make uses sentinel files to auto-resolve dependencies:
# node_modules/.package-lock.json ← tracks root npm install
# vendor/.../devContainersSpecCLI.js ← tracks vendored CLI build
# If either is missing or out-of-date, Make rebuilds it automatically.
#
# Publishing requires:
# OVSX_PAT environment variable (Personal Access Token from open-vsx.org)
# Publisher namespace claimed on Open VSX (one-time setup)
.PHONY: setup check lint typecheck test test-all test-coverage build release publish clean distclean
# ── Sentinel files ─────────────────────────────────────────────
NODE_MODULES := node_modules/.package-lock.json
VENDOR_CLI := vendor/devcontainers-cli/dist/spec-node/devContainersSpecCLI.js
# Change this to update the vendored CLI. make does the rest.
VENDOR_CLI_VERSION := v0.87.0
# ── Auto-setup (Make resolves these via file timestamps) ───────
$(NODE_MODULES): package.json package-lock.json
npm install
$(VENDOR_CLI):
@actual=$$(git -C vendor/devcontainers-cli describe --tags --exact-match 2>/dev/null); \
if [ "$$actual" != "$(VENDOR_CLI_VERSION)" ]; then \
echo "Switching vendor CLI: $$actual -> $(VENDOR_CLI_VERSION)"; \
git -C vendor/devcontainers-cli fetch --tags --quiet; \
git -C vendor/devcontainers-cli checkout -f $(VENDOR_CLI_VERSION) --quiet; \
rm -rf vendor/devcontainers-cli/node_modules vendor/devcontainers-cli/dist; \
fi
cd vendor/devcontainers-cli && npm install --ignore-scripts && npm run compile-prod && rm -f package-lock.json
# ── Explicit setup (convenience, equivalent to the chain above) ─
setup: $(VENDOR_CLI)
# ── Quality gates ──────────────────────────────────────────────
check: $(NODE_MODULES) lint test-all
@echo "=== All checks passed ==="
lint:
npm run lint
typecheck:
npm run typecheck
test:
npm test
test-all:
npm run test:all
test-coverage:
npm run test:coverage
# ── Build ──────────────────────────────────────────────────────
build: $(NODE_MODULES) $(VENDOR_CLI)
npm run package:kiro
npm run package:trae
npm run package:windsurf
npm run package:devin
npm run package:vscodium
# ── Release ────────────────────────────────────────────────────
release:
@test -n "$(VERSION)" || (echo "Usage: make release VERSION=x.y.z" && exit 1)
@echo "=== Releasing version $(VERSION) ==="
npm version $(VERSION) --no-git-tag-version
$(MAKE) check
$(MAKE) build
git add package.json package-lock.json
git commit -m "Release $(VERSION)"
git tag "v$(VERSION)"
@echo "=== Release $(VERSION) ready ==="
@echo "Next: git push --follow-tags, then make publish"
# ── Publish ────────────────────────────────────────────────────
publish:
@test -n "$$OVSX_PAT" || (echo "Set OVSX_PAT environment variable" && exit 1)
npx ovsx publish artizo-kiro-*.vsix
npx ovsx publish artizo-trae-*.vsix
npx ovsx publish artizo-windsurf-*.vsix
npx ovsx publish artizo-devin-*.vsix
npx ovsx publish artizo-vscodium-*.vsix
# ── Clean ──────────────────────────────────────────────────────
# clean: removes build artifacts only (dist/, coverage/).
# node_modules/ sentinel is untouched — no re-setup needed.
# distclean: also removes node_modules/ + vendored CLI build.
# sentinels are gone → next make auto-recovers.
clean:
rm -f artizo-*.vsix
rm -rf dist coverage
distclean: clean
rm -rf node_modules
rm -rf vendor/devcontainers-cli/node_modules
rm -rf vendor/devcontainers-cli/dist