-
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
62 lines (51 loc) · 1.77 KB
/
Makefile
File metadata and controls
62 lines (51 loc) · 1.77 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
.PHONY: build build-only check test lint clean watch install dev-link dev-unlink ui-dev
build: check
npm run build
build-only:
npm run build
check: lint test
lint:
npx tsc --noEmit
test:
npx vitest run
watch:
npm run build:watch
clean:
rm -rf dist
install:
npm install
ui-dev:
@port=$${MYCO_DAEMON_PORT:-$$(node -e ' \
var fs=require("fs"),p=require("path"),v=p.join(require("os").homedir(),".myco/vaults/myco"); \
try{console.log(JSON.parse(fs.readFileSync(p.join(v,"daemon.json"),"utf-8")).port);process.exit(0)}catch{} \
try{var y=fs.readFileSync(p.join(v,"myco.yaml"),"utf-8"),m=y.match(/^\\s*port:\\s*(\\d+)/m);if(m){console.log(m[1]);process.exit(0)}}catch{} \
console.log(19200)')}; \
echo "Proxying API to daemon on port $$port (override with MYCO_DAEMON_PORT=<port> make ui-dev)"; \
cd ui && MYCO_DAEMON_PORT=$$port npx vite dev
dev-link:
npm run build
@mkdir -p $(HOME)/.local/bin
@ln -sf $(PWD)/dist/src/cli.js $(HOME)/.local/bin/myco-dev
@chmod +x $(HOME)/.local/bin/myco-dev
@node -e '\
const fs = require("fs"); \
const p = ".claude/settings.json"; \
let s = {}; \
try { s = JSON.parse(fs.readFileSync(p, "utf-8")); } catch {} \
s.env = s.env || {}; \
s.env.MYCO_CMD = "myco-dev"; \
fs.writeFileSync(p, JSON.stringify(s, null, 2) + "\n");'
@echo "✓ myco-dev linked to local build"
@echo "✓ MYCO_CMD=myco-dev set in .claude/settings.json"
dev-unlink:
@rm -f $(HOME)/.local/bin/myco-dev
@node -e '\
const fs = require("fs"); \
const p = ".claude/settings.json"; \
try { \
const s = JSON.parse(fs.readFileSync(p, "utf-8")); \
if (s.env) { delete s.env.MYCO_CMD; } \
fs.writeFileSync(p, JSON.stringify(s, null, 2) + "\n"); \
} catch {}'
@echo "✓ myco-dev unlinked"
@echo "✓ MYCO_CMD removed from .claude/settings.json"