Repository navigation
Expand file tree
/
Copy pathMakefile
More file actions
57 lines (47 loc) · 2.77 KB
/
Copy pathMakefile
File metadata and controls
57 lines (47 loc) · 2.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
.PHONY: install-deps git-setup disable-workflows typecheck build-single generate tests
BUN := mise exec -- bun
# Tests for changes made in this fork, relative to each package.
TUI_FORK_TESTS := test/ui/directory-link.test.ts test/ui/directory-markdown.test.tsx test/util/session.test.ts \
test/cli/tui/data.test.tsx test/cli/tui/dialog-open.test.tsx test/cli/tui/prompt-move.test.tsx test/config.test.tsx \
test/context/session-tabs.test.tsx test/app-lifecycle.test.tsx test/component/session-tabs-rail.test.tsx \
test/component/line-comment.test.tsx
CORE_FORK_TESTS := test/plugin/custom.test.ts test/plugin/supervisor.test.ts test/tool-cancel.test.ts \
test/session-create.test.ts test/session-roots.test.ts test/session-skill.test.ts test/session-generate.test.ts \
test/session-owned.test.ts test/session-runner.test.ts test/tool-skill.test.ts test/file-access.test.ts \
test/bus-session-routing.test.ts test/subagent-lifetime.test.ts test/websearch.test.ts test/v1-migration.test.ts \
test/session-move.test.ts test/tool-opencode.test.ts test/merge-driver.test.ts test/plugin/custom-tools.test.ts \
test/plugin/retitle.test.ts
SCHEMA_FORK_TESTS := test/event-manifest.test.ts
SDK_FORK_TESTS := test/instances-effect.test.ts
install-deps: git-setup
$(BUN) install
# Merge drivers for the generated migration files named in .gitattributes.
git-setup:
git config merge.opencode-migration-registry.name "opencode migration registry"
git config merge.opencode-migration-registry.driver "$(BUN) packages/core/script/merge-driver.ts registry %O %A %B"
git config merge.opencode-schema-snapshot.name "opencode schema snapshot"
git config merge.opencode-schema-snapshot.driver "$(BUN) packages/core/script/merge-driver.ts snapshot %O %A %B"
FORK_REPO := sharunkumar/opencode
KEPT_WORKFLOWS := ci
# Disables every active workflow not in KEPT_WORKFLOWS; run after merging upstream.
disable-workflows:
GH_HOST=github.com gh workflow list -R $(FORK_REPO) --json id,name --jq '.[] | "\(.id) \(.name)"' | \
while read -r id name; do \
case " $(KEPT_WORKFLOWS) " in *" $$name "*) continue;; esac; \
echo "disabling $$name"; \
GH_HOST=github.com gh workflow disable "$$id" -R $(FORK_REPO); \
done
typecheck: install-deps
$(BUN) run typecheck
build-single: typecheck
$(BUN) run --cwd packages/cli build --single
tests: install-deps
# Merges keep the fork's generated files as text, but upstream can add sections that only regeneration fills in.
cd packages/protocol && $(BUN) run check:generated
cd packages/client && $(BUN) run check:generated
cd packages/tui && $(BUN) run test $(TUI_FORK_TESTS)
cd packages/core && $(BUN) run test $(CORE_FORK_TESTS)
cd packages/schema && $(BUN) run test $(SCHEMA_FORK_TESTS)
cd packages/sdk && $(BUN) run test $(SDK_FORK_TESTS)
generate: install-deps
./script/generate.ts