Add Node.js project tooling and config

This commit is contained in:
morluto
2026-07-12 03:25:06 +08:00
parent fbce15f990
commit b0301b81dd
8 changed files with 2913 additions and 0 deletions
+2
View File
@@ -6,6 +6,7 @@ __pycache__/
# Distribution
dist/
build/
node_modules/
*.egg-info/
*.egg
@@ -25,6 +26,7 @@ env/
.pytest_cache/
htmlcov/
.coverage
coverage/
# OS
.DS_Store
+3
View File
@@ -0,0 +1,3 @@
dist
node_modules
package-lock.json
+28
View File
@@ -0,0 +1,28 @@
import eslint from "@eslint/js";
import tseslint from "typescript-eslint";
export default tseslint.config(
{ ignores: ["dist/**", "node_modules/**"] },
eslint.configs.recommended,
...tseslint.configs.strictTypeChecked,
{
files: ["**/*.ts"],
languageOptions: {
parserOptions: {
projectService: true,
tsconfigRootDir: import.meta.dirname,
},
},
rules: {
"@typescript-eslint/consistent-type-imports": "error",
"@typescript-eslint/no-confusing-void-expression": "error",
"@typescript-eslint/no-floating-promises": "error",
"@typescript-eslint/no-non-null-assertion": "error",
"@typescript-eslint/no-unnecessary-condition": "error",
"@typescript-eslint/no-unsafe-type-assertion": "error",
"@typescript-eslint/only-throw-error": "error",
"@typescript-eslint/require-await": "error",
"@typescript-eslint/switch-exhaustiveness-check": "error",
},
},
);
+2800
View File
File diff suppressed because it is too large Load Diff
+39
View File
@@ -0,0 +1,39 @@
{
"name": "better-binary-mcp",
"version": "0.1.0",
"private": true,
"type": "module",
"bin": {
"better-binary-mcp": "./dist/main.js"
},
"engines": {
"node": ">=20"
},
"scripts": {
"build": "tsc -p tsconfig.build.json",
"check": "npm run typecheck && npm run lint && npm run format:check && npm test",
"format": "prettier --write .",
"format:check": "prettier --check .",
"lint": "eslint 'src/**/*.ts' 'tests/**/*.ts' vitest.config.ts",
"start": "node dist/main.js",
"pretest": "npm run build",
"test": "vitest run",
"test:watch": "vitest",
"typecheck": "tsc --noEmit",
"verify:hopper": "npm run build && node scripts/verify-real-hopper.mjs"
},
"dependencies": {
"@modelcontextprotocol/server": "2.0.0-beta.3",
"zod": "4.4.3"
},
"devDependencies": {
"@eslint/js": "9.39.2",
"@modelcontextprotocol/client": "2.0.0-beta.3",
"@types/node": "24.10.1",
"eslint": "9.39.2",
"prettier": "3.6.2",
"typescript": "5.9.3",
"typescript-eslint": "8.48.1",
"vitest": "4.1.10"
}
}
+9
View File
@@ -0,0 +1,9 @@
{
"extends": "./tsconfig.json",
"compilerOptions": {
"rootDir": "src",
"types": ["node"]
},
"include": ["src/**/*.ts"],
"exclude": ["src/**/*.test.ts", "tests", "dist", "node_modules"]
}
+24
View File
@@ -0,0 +1,24 @@
{
"compilerOptions": {
"allowUnreachableCode": false,
"allowUnusedLabels": false,
"exactOptionalPropertyTypes": true,
"forceConsistentCasingInFileNames": true,
"lib": ["ES2023"],
"module": "NodeNext",
"moduleResolution": "NodeNext",
"noFallthroughCasesInSwitch": true,
"noImplicitOverride": true,
"noImplicitReturns": true,
"noUncheckedIndexedAccess": true,
"outDir": "dist",
"rootDir": ".",
"skipLibCheck": false,
"strict": true,
"target": "ES2023",
"types": ["node"],
"verbatimModuleSyntax": true
},
"include": ["src/**/*.ts", "tests/**/*.ts", "vitest.config.ts"],
"exclude": ["dist", "node_modules"]
}
+8
View File
@@ -0,0 +1,8 @@
import { defineConfig } from "vitest/config";
export default defineConfig({
test: {
coverage: { enabled: false },
include: ["tests/**/*.test.ts"],
},
});