diff --git a/.github/workflows/typecheck.yml b/.github/workflows/typecheck.yml new file mode 100644 index 0000000..c0fad44 --- /dev/null +++ b/.github/workflows/typecheck.yml @@ -0,0 +1,27 @@ +name: TypeScript Checks + +on: + pull_request: + push: + branches: [main] + +jobs: + typecheck: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-node@v4 + with: + node-version: "20" + cache: "npm" + + - run: npm ci + - run: npm run typecheck + - run: npm run build + - name: Verify declaration output + run: | + test -s dist/index.d.ts + if find dist -name "*.d.ts" -type f -empty -print -quit | grep -q .; then + echo "Empty declaration file found" + exit 1 + fi diff --git a/package.json b/package.json index 6f80c8a..9715bfc 100644 --- a/package.json +++ b/package.json @@ -6,6 +6,7 @@ "types": "dist/index.d.ts", "scripts": { "build": "tsc", + "typecheck": "tsc --noEmit", "prepublishOnly": "npm run build" }, "keywords": [