-
-
Notifications
You must be signed in to change notification settings - Fork 21
Expand file tree
/
Copy pathTaskfile.yml
More file actions
177 lines (147 loc) · 5.03 KB
/
Taskfile.yml
File metadata and controls
177 lines (147 loc) · 5.03 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
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
version: '3'
vars:
BUNDLE_NAME: bear-notes-mcpb-{{now | date "20060102"}}.mcpb
tasks:
default:
desc: Show available tasks
cmds:
- task --list
inspector:
desc: Run MCP inspector with Web UI
cmds:
- npx @modelcontextprotocol/inspector node dist/main.js
setup:
desc: Project setup (install + build)
cmds:
- npm install
- npm run build
style:
desc: Runs linter and formatter with fixes
cmds:
- npm run lint
- npm run format
clean:
desc: Clean build artifacts
cmds:
- rm -rf dist tmp *.mcpb
build:
desc: Build with quality checks
deps: [clean]
cmds:
- npm run check
- npm run test
- npm run build
test:system:
if: '{{ ne .CI "true" }}' # Skip in CI as there is no system test environment set up yet
desc: Run system tests with MCP Inspector CLI
cmds:
- npm run test:system
# === Dependencies ===
deps:dev:
desc: Update all dev dependencies to latest and pin to exact versions
cmds:
- npx npm-check-updates --upgrade --dep dev --removeRange --peer
- npm install
- npm run test
- npm run build
- echo "Dev deps updated and pinned. Review package.json + package-lock.json diff before committing."
deps:prod:
desc: Update all prod dependencies to latest and pin to exact versions
cmds:
- npx npm-check-updates --upgrade --dep prod --removeRange --peer
- npm install
- npm run test
- npm run build
- echo "Prod deps updated and pinned. Review package.json + package-lock.json diff before committing."
# === Website ===
website:dev:
desc: Start website dev server (network-accessible)
cmds:
- cd website && npx astro dev --host
website:stop:
desc: Stop website dev server
cmds:
- lsof -ti:4321 | xargs kill -9 2>/dev/null && echo "Stopped" || echo "Not running"
# === Bundle Build ===
pack:
desc: Create production bundle
# deps: [build, test:system]
cmds:
- task: build
- task: test:system # In CI, when skipped, this will be considered as success run
- rm -rf tmp/bundle && mkdir -p tmp/bundle
# `cp -R dist/. tmp/bundle/` copies the contents of dist/ (including the
# tools/, operations/, infra/ subdirectories produced by the layered
# src/ tree) into tmp/bundle/. The trailing `/.` matters: without it,
# we'd get tmp/bundle/dist/ and manifest.json's entry_point="main.js"
# would fail to resolve.
- cp -R dist/. tmp/bundle/
- cp -r assets/* manifest.json package.json tmp/bundle/
- cd tmp/bundle && npx mcpb validate manifest.json
- cd tmp/bundle && npm install --omit=dev
- npx mcpb pack tmp/bundle {{.BUNDLE_NAME}}
- echo "Bundle created {{.BUNDLE_NAME}}"
info:
desc: Show bundle info
cmds:
- npx mcpb info {{.BUNDLE_NAME}}
docs:sync:
desc: Sync tools list from manifest.json into README.md and docs/user/NPM.md
cmds:
- node scripts/sync-tools-to-docs.mjs
version:
desc: Update version across all files
interactive: true
requires:
vars:
- VERSION
prompt: "Confirm version update to {{.VERSION}}?"
preconditions:
- sh: echo "{{.VERSION}}" | grep -E '^[0-9]+\.[0-9]+\.[0-9]+(-[0-9A-Za-z.-]+)?$'
msg: "VERSION must follow semver format (x.y.z[-prerelease])"
cmds:
- |
echo "Updating version to {{.VERSION}}"
perl -pi -e 's/"version": "[^"]*"/"version": "{{.VERSION}}"/' package.json
perl -pi -e 's/"version": "[^"]*"/"version": "{{.VERSION}}"/' manifest.json
perl -pi -e "s/export const APP_VERSION = '[^']*'/export const APP_VERSION = '{{.VERSION}}'/" src/config.ts
echo "Version updated to {{.VERSION}} in package.json, manifest.json, and src/config.ts"
- npm install --package-lock-only
prepare-release:
desc: Prepare release by updating version and docs
cmds:
- task: docs:sync
- task: version
push-release:
desc: Commit, tag, and push a release
requires:
vars:
- VERSION
- SHORT_DESCRIPTION
preconditions:
- sh: test "$(git branch --show-current)" = "main"
msg: Must be on main branch
- sh: test -z "$(git status --porcelain)"
msg: Working tree must be clean
prompt: "Release v{{.VERSION}} ({{.SHORT_DESCRIPTION}})?"
cmds:
- |
git commit --allow-empty -m "release: {{.VERSION}} - {{.SHORT_DESCRIPTION}}"
git tag -a "v{{.VERSION}}" -m "release: {{.VERSION}}"
git push --follow-tags
changelog:
silent: true
desc: Extract changelog for specific version
vars:
VERSION: '{{.VERSION | default "1.0.0"}}'
cmds:
- |
if [ ! -f CHANGELOG.md ]; then
echo "CHANGELOG.md not found"
exit 1
fi
# Extract content between ## [VERSION] and next ## section
sed -n "/^## \[{{.VERSION}}\]/,/^## \[/p" CHANGELOG.md | \
sed '$d' | \
tail -n +3 | \
sed '/^$/d'