From 3d7d482affd2814d0d83c0ad1a51dea093fa627c Mon Sep 17 00:00:00 2001 From: Jonathan Haines Date: Thu, 27 Mar 2025 13:23:05 +1100 Subject: [PATCH] build(node-ws): lint published package (#1052) --- .github/workflows/ci-node-ws.yml | 1 + packages/node-ws/package.json | 34 +++++++++++++++++++++----------- packages/node-ws/tsconfig.json | 10 ++-------- yarn.lock | 15 ++++++++------ 4 files changed, 34 insertions(+), 26 deletions(-) diff --git a/.github/workflows/ci-node-ws.yml b/.github/workflows/ci-node-ws.yml index e6c25685..b7fc027f 100644 --- a/.github/workflows/ci-node-ws.yml +++ b/.github/workflows/ci-node-ws.yml @@ -19,6 +19,7 @@ jobs: node-version: 20.x - run: yarn workspaces focus hono-middleware @hono/node-ws - run: yarn workspace @hono/node-ws build + - run: yarn workspace @hono/node-ws publint - run: yarn test --coverage --project @hono/node-ws - uses: codecov/codecov-action@v5 with: diff --git a/packages/node-ws/package.json b/packages/node-ws/package.json index d16b1362..66e96167 100644 --- a/packages/node-ws/package.json +++ b/packages/node-ws/package.json @@ -2,23 +2,29 @@ "name": "@hono/node-ws", "version": "1.1.0", "description": "WebSocket helper for Node.js", + "type": "module", "main": "dist/index.js", - "module": "dist/index.mjs", + "module": "dist/index.js", "types": "dist/index.d.ts", "files": [ "dist" ], "scripts": { - "test": "tsc --noEmit && 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,14 +34,18 @@ }, "repository": { "type": "git", - "url": "https://github.com/honojs/middleware.git" + "url": "git+https://github.com/honojs/middleware.git", + "directory": "packages/node-ws" }, "homepage": "https://github.com/honojs/middleware", "devDependencies": { + "@arethetypeswrong/cli": "^0.17.4", "@hono/node-server": "^1.11.1", - "@types/ws": "^8", + "@types/node": "^20.14.8", + "@types/ws": "^8.18.0", "hono": "^4.6.0", - "tsup": "^8.0.1", + "publint": "^0.3.9", + "tsup": "^8.4.0", "vitest": "^3.0.8" }, "dependencies": { @@ -48,4 +58,4 @@ "engines": { "node": ">=18.14.1" } -} +} \ No newline at end of file diff --git a/packages/node-ws/tsconfig.json b/packages/node-ws/tsconfig.json index c4bdc510..869e4530 100644 --- a/packages/node-ws/tsconfig.json +++ b/packages/node-ws/tsconfig.json @@ -1,13 +1,7 @@ { "extends": "../../tsconfig.json", "compilerOptions": { - "rootDir": "./src", "outDir": "./dist", - "types": [ - "vitest/globals" - ] - }, - "include": [ - "src/**/*.ts" - ] + "types": ["node", "vitest/globals", "ws"] + } } diff --git a/yarn.lock b/yarn.lock index cfae60f4..2ab858b0 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2693,10 +2693,13 @@ __metadata: version: 0.0.0-use.local resolution: "@hono/node-ws@workspace:packages/node-ws" dependencies: + "@arethetypeswrong/cli": "npm:^0.17.4" "@hono/node-server": "npm:^1.11.1" - "@types/ws": "npm:^8" + "@types/node": "npm:^20.14.8" + "@types/ws": "npm:^8.18.0" hono: "npm:^4.6.0" - tsup: "npm:^8.0.1" + publint: "npm:^0.3.9" + tsup: "npm:^8.4.0" vitest: "npm:^3.0.8" ws: "npm:^8.17.0" peerDependencies: @@ -4842,12 +4845,12 @@ __metadata: languageName: node linkType: hard -"@types/ws@npm:^8": - version: 8.5.10 - resolution: "@types/ws@npm:8.5.10" +"@types/ws@npm:^8.18.0": + version: 8.18.0 + resolution: "@types/ws@npm:8.18.0" dependencies: "@types/node": "npm:*" - checksum: e9af279b984c4a04ab53295a40aa95c3e9685f04888df5c6920860d1dd073fcc57c7bd33578a04b285b2c655a0b52258d34bee0a20569dca8defb8393e1e5d29 + checksum: a56d2e0d1da7411a1f3548ce02b51a50cbe9e23f025677d03df48f87e4a3c72e1342fbf1d12e487d7eafa8dc670c605152b61bbf9165891ec0e9694b0d3ea8d4 languageName: node linkType: hard