From 2514e033823b1fc679dca1de690e5180dae012c3 Mon Sep 17 00:00:00 2001 From: Jonathan Haines Date: Thu, 27 Mar 2025 12:59:12 +1100 Subject: [PATCH] build(event-emitter): lint published package (#1047) --- .github/workflows/ci-event-emitter.yml | 1 + packages/event-emitter/package.json | 31 +++++++++++++++++--------- packages/event-emitter/tsconfig.json | 10 +++------ yarn.lock | 4 +++- 4 files changed, 27 insertions(+), 19 deletions(-) diff --git a/.github/workflows/ci-event-emitter.yml b/.github/workflows/ci-event-emitter.yml index d14a1eb4..1b600492 100644 --- a/.github/workflows/ci-event-emitter.yml +++ b/.github/workflows/ci-event-emitter.yml @@ -19,6 +19,7 @@ jobs: node-version: 20.x - run: yarn workspaces focus hono-middleware @hono/event-emitter - run: yarn workspace @hono/event-emitter build + - run: yarn workspace @hono/event-emitter publint - run: yarn test --coverage --project @hono/event-emitter - uses: codecov/codecov-action@v5 with: diff --git a/packages/event-emitter/package.json b/packages/event-emitter/package.json index fc035582..f0b89543 100644 --- a/packages/event-emitter/package.json +++ b/packages/event-emitter/package.json @@ -2,23 +2,29 @@ "name": "@hono/event-emitter", "version": "2.0.0", "description": "Event Emitter middleware for Hono", + "type": "module", "main": "dist/index.js", - "module": "dist/index.mjs", + "module": "dist/index.js", "types": "dist/index.d.ts", "files": [ "dist" ], "scripts": { - "test": "vitest --run", - "build": "tsup ./src/index.ts --format esm,cjs --dts", - "publint": "publint", - "release": "yarn build && yarn test && yarn publint && yarn publish" + "build": "tsup ./src/index.ts", + "prepack": "yarn build", + "publint": "attw --pack && publint", + "test": "vitest" }, "exports": { ".": { - "types": "./dist/index.d.mts", - "import": "./dist/index.mjs", - "require": "./dist/index.js" + "import": { + "types": "./dist/index.d.ts", + "default": "./dist/index.js" + }, + "require": { + "types": "./dist/index.d.cts", + "default": "./dist/index.cjs" + } } }, "license": "MIT", @@ -28,7 +34,8 @@ }, "repository": { "type": "git", - "url": "https://github.com/honojs/middleware.git" + "url": "git+https://github.com/honojs/middleware.git", + "directory": "packages/event-emitter" }, "homepage": "https://github.com/honojs/middleware", "author": "David Havl (https://github.com/DavidHavl)", @@ -36,11 +43,13 @@ "hono": "*" }, "devDependencies": { + "@arethetypeswrong/cli": "^0.17.4", "hono": "^4.3.6", - "tsup": "^8.0.1", + "publint": "^0.3.9", + "tsup": "^8.4.0", "vitest": "^3.0.8" }, "engines": { "node": ">=16.0.0" } -} +} \ No newline at end of file diff --git a/packages/event-emitter/tsconfig.json b/packages/event-emitter/tsconfig.json index acfcd843..9f275945 100644 --- a/packages/event-emitter/tsconfig.json +++ b/packages/event-emitter/tsconfig.json @@ -1,10 +1,6 @@ { "extends": "../../tsconfig.json", "compilerOptions": { - "rootDir": "./src", - "outDir": "./dist", - }, - "include": [ - "src/**/*.ts" - ], -} \ No newline at end of file + "outDir": "./dist" + } +} diff --git a/yarn.lock b/yarn.lock index 3f16463d..fc7ca82b 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2605,8 +2605,10 @@ __metadata: version: 0.0.0-use.local resolution: "@hono/event-emitter@workspace:packages/event-emitter" dependencies: + "@arethetypeswrong/cli": "npm:^0.17.4" hono: "npm:^4.3.6" - tsup: "npm:^8.0.1" + publint: "npm:^0.3.9" + tsup: "npm:^8.4.0" vitest: "npm:^3.0.8" peerDependencies: hono: "*"