From ff2c1cd2fc332ad7d9ad52407997911ac8116cef Mon Sep 17 00:00:00 2001 From: Jonathan Haines Date: Thu, 27 Mar 2025 17:08:49 +1100 Subject: [PATCH] build(zod-openapi): lint published package (#1069) --- .github/workflows/ci-zod-openapi.yml | 1 + package.json | 2 +- packages/zod-openapi/package.json | 29 ++++++++++++----------- packages/zod-openapi/tsconfig.json | 11 ++------- packages/zod-openapi/tsconfig.vitest.json | 12 ---------- packages/zod-openapi/vitest.config.ts | 3 ++- yarn.lock | 15 ++++-------- 7 files changed, 25 insertions(+), 48 deletions(-) delete mode 100644 packages/zod-openapi/tsconfig.vitest.json diff --git a/.github/workflows/ci-zod-openapi.yml b/.github/workflows/ci-zod-openapi.yml index 8d1f8f1c..5f1c6725 100644 --- a/.github/workflows/ci-zod-openapi.yml +++ b/.github/workflows/ci-zod-openapi.yml @@ -19,6 +19,7 @@ jobs: node-version: 18.x - run: yarn workspaces focus hono-middleware @hono/zod-openapi - run: yarn workspace @hono/zod-openapi build + - run: yarn workspace @hono/zod-openapi publint - run: yarn test --coverage --project @hono/zod-openapi - uses: codecov/codecov-action@v5 with: diff --git a/package.json b/package.json index 4a4b0506..0d792a25 100644 --- a/package.json +++ b/package.json @@ -71,7 +71,7 @@ "npm-run-all2": "^6.2.2", "prettier": "^2.7.1", "tsup": "^8.4.0", - "typescript": "^5.2.2", + "typescript": "^5.8.2", "vitest": "^3.0.8" }, "packageManager": "yarn@4.0.2" diff --git a/packages/zod-openapi/package.json b/packages/zod-openapi/package.json index 7036d0d2..90f83a22 100644 --- a/packages/zod-openapi/package.json +++ b/packages/zod-openapi/package.json @@ -2,27 +2,27 @@ "name": "@hono/zod-openapi", "version": "0.19.2", "description": "A wrapper class of Hono which supports OpenAPI.", - "main": "dist/index.js", - "module": "dist/index.mjs", + "type": "module", + "module": "dist/index.js", "types": "dist/index.d.ts", "files": [ "dist" ], "scripts": { - "test": "vitest run && vitest --typecheck --run --passWithNoTests", - "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": { ".": { "import": { - "types": "./dist/index.d.mts", - "default": "./dist/index.mjs" - }, - "require": { "types": "./dist/index.d.ts", "default": "./dist/index.js" + }, + "require": { + "types": "./dist/index.d.cts", + "default": "./dist/index.cjs" } } }, @@ -33,7 +33,8 @@ }, "repository": { "type": "git", - "url": "https://github.com/honojs/middleware.git" + "url": "git+https://github.com/honojs/middleware.git", + "directory": "packages/zod-openapi" }, "homepage": "https://github.com/honojs/middleware", "peerDependencies": { @@ -41,10 +42,10 @@ "zod": "3.*" }, "devDependencies": { - "@cloudflare/workers-types": "^4.20240117.0", + "@arethetypeswrong/cli": "^0.17.4", "hono": "^4.6.10", - "tsup": "^8.0.1", - "typescript": "^5.8.2", + "publint": "^0.3.9", + "tsup": "^8.4.0", "vitest": "^3.0.8", "yaml": "^2.4.3", "zod": "^3.22.1" diff --git a/packages/zod-openapi/tsconfig.json b/packages/zod-openapi/tsconfig.json index 28c65532..dcc1e9e9 100644 --- a/packages/zod-openapi/tsconfig.json +++ b/packages/zod-openapi/tsconfig.json @@ -1,13 +1,6 @@ { "extends": "../../tsconfig.json", "compilerOptions": { - "rootDir": "./src", - }, - "include": [ - "src/", - ], - "exclude": [ - "node_modules", - "dist" - ] + "types": ["vitest/globals"] + } } diff --git a/packages/zod-openapi/tsconfig.vitest.json b/packages/zod-openapi/tsconfig.vitest.json deleted file mode 100644 index f48fdba3..00000000 --- a/packages/zod-openapi/tsconfig.vitest.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "extends": "../../tsconfig.json", - "compilerOptions": { - "types": [ - "vitest/globals", - ], - }, - "include": [ - "src/", - "test/" - ], -} diff --git a/packages/zod-openapi/vitest.config.ts b/packages/zod-openapi/vitest.config.ts index e406a162..5cc451db 100644 --- a/packages/zod-openapi/vitest.config.ts +++ b/packages/zod-openapi/vitest.config.ts @@ -4,7 +4,8 @@ export default defineProject({ test: { globals: true, typecheck: { - tsconfig: './tsconfig.vitest.json', + tsconfig: './tsconfig.json', + enabled: true, }, }, }) diff --git a/yarn.lock b/yarn.lock index 1c2044d5..a0b151d2 100644 --- a/yarn.lock +++ b/yarn.lock @@ -855,13 +855,6 @@ __metadata: languageName: node linkType: hard -"@cloudflare/workers-types@npm:^4.20240117.0": - version: 4.20240117.0 - resolution: "@cloudflare/workers-types@npm:4.20240117.0" - checksum: 900b796af2ae97257e1f6171b9c37d718c5f8ae064cea8f8d1c48e52ccde01492c5cfa61716fc703d05a6bd92e50a55f7d9e525d2c91919db76e42458c3e8e76 - languageName: node - linkType: hard - "@cloudflare/workers-types@npm:^4.20240222.0": version: 4.20240222.0 resolution: "@cloudflare/workers-types@npm:4.20240222.0" @@ -2977,12 +2970,12 @@ __metadata: version: 0.0.0-use.local resolution: "@hono/zod-openapi@workspace:packages/zod-openapi" dependencies: + "@arethetypeswrong/cli": "npm:^0.17.4" "@asteasolutions/zod-to-openapi": "npm:^7.1.0" - "@cloudflare/workers-types": "npm:^4.20240117.0" "@hono/zod-validator": "npm:0.4.2" hono: "npm:^4.6.10" - tsup: "npm:^8.0.1" - typescript: "npm:^5.8.2" + publint: "npm:^0.3.9" + tsup: "npm:^8.4.0" vitest: "npm:^3.0.8" yaml: "npm:^2.4.3" zod: "npm:^3.22.1" @@ -10153,7 +10146,7 @@ __metadata: npm-run-all2: "npm:^6.2.2" prettier: "npm:^2.7.1" tsup: "npm:^8.4.0" - typescript: "npm:^5.2.2" + typescript: "npm:^5.8.2" vitest: "npm:^3.0.8" languageName: unknown linkType: soft