Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@
node_modules
build
.env
reports
34 changes: 28 additions & 6 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@

.DEFAULT_GOAL := build

# build and test rely on their prerequisites running in order.
.NOTPARALLEL:

.PHONY: install hooks inspector build compile typecheck bundle \
test unit-test ci-install ci-unit-test publish bump

install: hooks
npm install

Expand All @@ -11,16 +17,32 @@ hooks:
inspector:
npx -y @modelcontextprotocol/inspector npx -y tsx src/main.ts

build: install
npx tsc --noEmit \
&& npx esbuild src/main.ts --bundle --platform=node --format=esm --banner:js='#!/usr/bin/env node' --outfile=build/main.mjs \
&& chmod +x build/main.mjs
build: install compile

test: build
npx vitest run
test: build unit-test

publish: test
npm publish

bump:
@node scripts/bump-version.mjs $(VERSION)

ci-install:
npm ci

typecheck:
npx tsc --noEmit

bundle:
npx esbuild src/main.ts --bundle --platform=node --format=esm \
--banner:js='#!/usr/bin/env node' --outfile=build/main.mjs
chmod +x build/main.mjs

compile: typecheck bundle

unit-test:
npx vitest run

ci-unit-test:
npx vitest run --reporter=default \
--reporter=junit --outputFile.junit=reports/junit/results.xml
2 changes: 1 addition & 1 deletion tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -110,5 +110,5 @@
// "skipDefaultLibCheck": true, /* Skip type checking .d.ts files that are included with TypeScript. */
"skipLibCheck": true /* Skip type checking all .d.ts files. */
},
"exclude": []
"exclude": ["node_modules", "build"]
}
Loading