Repository: honojs/middleware
Pull request #1046: build(esbuild-transpiler): lint published package
Author: login: BarryThePenguin
Created: 2025-03-26T10:54:58Z | Merged: 2025-03-27T02:06:41Z



Diff:
diff --git a/.github/workflows/ci-esbuild-transpiler.yml b/.github/workflows/ci-esbuild-transpiler.yml
index 0a41953e0..e4d53a92d 100644
--- a/.github/workflows/ci-esbuild-transpiler.yml
+++ b/.github/workflows/ci-esbuild-transpiler.yml
@@ -19,6 +19,7 @@ jobs:
           node-version: 20.x
       - run: yarn workspaces focus hono-middleware @hono/esbuild-transpiler
       - run: yarn workspace @hono/esbuild-transpiler build
+      - run: yarn workspace @hono/esbuild-transpiler publint
       - run: yarn test --coverage --project @hono/esbuild-transpiler
       - uses: codecov/codecov-action@v5
         with:
diff --git a/packages/esbuild-transpiler/package.json b/packages/esbuild-transpiler/package.json
index 8ef3c1d6c..64d6ce6d3 100644
--- a/packages/esbuild-transpiler/package.json
+++ b/packages/esbuild-transpiler/package.json
@@ -2,32 +2,48 @@
   "name": "@hono/esbuild-transpiler",
   "version": "0.1.3",
   "description": "esbuild Transpiler Middleware for Hono",
-  "main": "dist/index.js",
   "type": "module",
+  "module": "dist/index.js",
   "types": "dist/index.d.ts",
   "files": [
     "dist"
   ],
   "scripts": {
-    "test": "vitest run",
-    "build": "tsup ./src/*.ts ./src/transpilers/*.ts --format esm,cjs --dts --no-splitting --external esbuild-wasm,esbuild",
-    "publint": "publint",
-    "release": "yarn build && yarn test && yarn publint && yarn publish"
+    "build": "tsup ./src/*.ts ./src/transpilers/*.ts --no-splitting --external esbuild-wasm,esbuild",
+    "prepack": "yarn build",
+    "publint": "attw --pack && publint",
+    "test": "vitest"
   },
   "exports": {
     ".": {
-      "import": "./dist/index.js",
-      "require": "./dist/index.cjs"
+      "import": {
+        "types": "./dist/index.d.ts",
+        "default": "./dist/index.js"
+      },
+      "require": {
+        "types": "./dist/index.d.cts",
+        "default": "./dist/index.cjs"
+      }
     },
     "./wasm": {
-      "types": "./dist/transpilers/wasm.d.ts",
-      "import": "./dist/transpilers/wasm.js",
-      "require": "./dist/transpilers/wasm.cjs"
+      "import": {
+        "types": "./dist/transpilers/wasm.d.ts",
+        "default": "./dist/transpilers/wasm.js"
+      },
+      "require": {
+        "types": "./dist/transpilers/wasm.d.cts",
+        "default": "./dist/transpilers/wasm.cjs"
+      }
     },
     "./node": {
-      "types": "./dist/transpilers/node.d.ts",
-      "import": "./dist/transpilers/node.js",
-      "require": "./dist/transpilers/node.cjs"
+      "import": {
+        "types": "./dist/transpilers/node.d.ts",
+        "default": "./dist/transpilers/node.js"
+      },
+      "require": {
+        "types": "./dist/transpilers/node.d.cts",
+        "default": "./dist/transpilers/node.cjs"
+      }
     }
   },
   "typesVersions": {
@@ -47,20 +63,23 @@
   },
   "repository": {
     "type": "git",
-    "url": "https://github.com/honojs/middleware.git"
+    "url": "git+https://github.com/honojs/middleware.git",
+    "directory": "packages/esbuild-transpiler"
   },
   "homepage": "https://github.com/honojs/middleware",
   "peerDependencies": {
     "hono": ">=3.9.2"
   },
   "devDependencies": {
+    "@arethetypeswrong/cli": "^0.17.4",
     "esbuild": "^0.19.9",
     "esbuild-wasm": "^0.19.5",
     "hono": "^3.11.7",
-    "tsup": "^8.0.1",
+    "publint": "^0.3.9",
+    "tsup": "^8.4.0",
     "vitest": "^3.0.8"
   },
   "engines": {
     "node": ">=18.14.1"
   }
-}
+}
\ No newline at end of file
diff --git a/packages/esbuild-transpiler/tsconfig.json b/packages/esbuild-transpiler/tsconfig.json
index 8eaee1b95..f63ac4533 100644
--- a/packages/esbuild-transpiler/tsconfig.json
+++ b/packages/esbuild-transpiler/tsconfig.json
@@ -1,14 +1,6 @@
 {
   "extends": "../../tsconfig.json",
   "compilerOptions": {
-    "skipLibCheck": false,
-    "rootDir": "./src",
-  },
-  "include": [
-    "src/**/*.ts"
-  ],
-  "exclude": [
-    "node_modules",
-    "dist"
-  ]
-}
\ No newline at end of file
+    "skipLibCheck": false
+  }
+}
diff --git a/yarn.lock b/yarn.lock
index 09d078a3e..e1dd6e836 100644
--- a/yarn.lock
+++ b/yarn.lock
@@ -2732,10 +2732,12 @@ __metadata:
   version: 0.0.0-use.local
   resolution: "@hono/esbuild-transpiler@workspace:packages/esbuild-transpiler"
   dependencies:
+    "@arethetypeswrong/cli": "npm:^0.17.4"
     esbuild: "npm:^0.19.9"
     esbuild-wasm: "npm:^0.19.5"
     hono: "npm:^3.11.7"
-    tsup: "npm:^8.0.1"
+    publint: "npm:^0.3.9"
+    tsup: "npm:^8.4.0"
     vitest: "npm:^3.0.8"
   peerDependencies:
     hono: ">=3.9.2"


Reviews:
user: login: BarryThePenguin
state: COMMENTED
author_association: CONTRIBUTOR
submitted_at: 2025-03-26T10:57:20Z
user: login: yusukebe
state: CHANGES_REQUESTED
author_association: MEMBER
submitted_at: 2025-03-27T01:58:16Z
user: login: BarryThePenguin
state: COMMENTED
author_association: CONTRIBUTOR
submitted_at: 2025-03-27T02:01:06Z
user: login: yusukebe
state: COMMENTED
author_association: MEMBER
submitted_at: 2025-03-27T02:06:08Z
user: login: yusukebe
body: LGTM!
state: APPROVED
author_association: MEMBER
submitted_at: 2025-03-27T02:06:35Z

Review comments:
diff_hunk: @@ -2,32 +2,48 @@
   "name": "@hono/esbuild-transpiler",
   "version": "0.1.3",
   "description": "esbuild Transpiler Middleware for Hono",
-  "main": "dist/index.js",
   "type": "module",
+  "module": "dist/index.js",
   "types": "dist/index.d.ts",
   "files": [
     "dist"
   ],
   "scripts": {
-    "test": "vitest run",
-    "build": "tsup ./src/*.ts ./src/transpilers/*.ts --format esm,cjs --dts --no-splitting --external esbuild-wasm,esbuild",
-    "publint": "publint",
-    "release": "yarn build && yarn test && yarn publint && yarn publish"
+    "build": "tsup ./src/*.ts ./src/transpilers/*.ts --no-splitting --external esbuild-wasm,esbuild",
path: packages/esbuild-transpiler/package.json
user: login: BarryThePenguin
body: It looks like `--no-splitting` is actually doing something in this case, so I've left it in
created_at: 2025-03-26T10:57:19Z
author_association: CONTRIBUTOR
diff_hunk: @@ -47,20 +63,23 @@
   },
   "repository": {
     "type": "git",
-    "url": "https://github.com/honojs/middleware.git"
+    "url": "git+https://github.com/honojs/middleware.git",
+    "directory": "esbuild-transpiler"
path: packages/esbuild-transpiler/package.json
user: login: yusukebe
body: This should be `packages/esbuild-transpiler`.
created_at: 2025-03-27T01:58:11Z
author_association: MEMBER
diff_hunk: @@ -47,20 +63,23 @@
   },
   "repository": {
     "type": "git",
-    "url": "https://github.com/honojs/middleware.git"
+    "url": "git+https://github.com/honojs/middleware.git",
+    "directory": "esbuild-transpiler"
path: packages/esbuild-transpiler/package.json
user: login: BarryThePenguin
body: Nice pickup, thanks!

```suggestion
    "directory": "packages/esbuild-transpiler"
```

I did seperate PRs hoping it would be easier to review and pickup small things like this. Sorry there are so many! 😅 
created_at: 2025-03-27T02:01:06Z
author_association: CONTRIBUTOR
diff_hunk: @@ -47,20 +63,23 @@
   },
   "repository": {
     "type": "git",
-    "url": "https://github.com/honojs/middleware.git"
+    "url": "git+https://github.com/honojs/middleware.git",
+    "directory": "esbuild-transpiler"
path: packages/esbuild-transpiler/package.json
user: login: yusukebe
body: No problem!
created_at: 2025-03-27T02:06:08Z
author_association: MEMBER

PR comments:
user: login: changeset-bot[bot]
created_at: 2025-03-26T10:55:01Z
body: ###  ⚠️  No Changeset found

Latest commit: f2f70d59f7eb64ca91aca42458637807d55654e6

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. **If these changes should result in a version bump, you need to add a changeset.**

<details><summary>This PR includes no changesets</summary>

  When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

</details>

[Click here to learn what changesets are, and how to add one](https://github.com/changesets/changesets/blob/main/docs/adding-a-changeset.md).

[Click here if you're a maintainer who wants to add a changeset to this PR](https://github.com/BarryThePenguin/middleware/new/refactor/build/esbuild-transpiler?filename=.changeset/thick-eyes-check.md&value=---%0A%22%40hono%2Fesbuild-transpiler%22%3A%20patch%0A---%0A%0Abuild(esbuild-transpiler)%3A%20lint%20published%20package%0A)


author_association: NONE
user: login: codecov-commenter
created_at: 2025-03-26T10:56:19Z
body: ## [Codecov](https://app.codecov.io/gh/honojs/middleware/pull/1046?dropdown=coverage&src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=honojs) Report
All modified and coverable lines are covered by tests :white_check_mark:
> Project coverage is 78.13%. Comparing base [(`3b9d2d2`)](https://app.codecov.io/gh/honojs/middleware/commit/3b9d2d29905b06984a4c6492e8682c409abf2dc3?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=honojs) to head [(`f2f70d5`)](https://app.codecov.io/gh/honojs/middleware/commit/f2f70d59f7eb64ca91aca42458637807d55654e6?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=honojs).
> Report is 7 commits behind head on main.

<details><summary>Additional details and impacted files</summary>


```diff
@@           Coverage Diff           @@
##             main    #1046   +/-   ##
=======================================
  Coverage   78.13%   78.13%           
=======================================
  Files          74       74           
  Lines        2131     2131           
  Branches      555      555           
=======================================
  Hits         1665     1665           
  Misses        390      390           
  Partials       76       76           
```

| [Flag](https://app.codecov.io/gh/honojs/middleware/pull/1046/flags?src=pr&el=flags&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=honojs) | Coverage Δ | |
|---|---|---|
| [esbuild-transpiler](https://app.codecov.io/gh/honojs/middleware/pull/1046/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=honojs) | `1.03% <ø> (-0.01%)` | :arrow_down: |

Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=honojs#carryforward-flags-in-the-pull-request-comment) to find out more.

</details>

[:umbrella: View full report in Codecov by Sentry](https://app.codecov.io/gh/honojs/middleware/pull/1046?dropdown=coverage&src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=honojs).   
:loudspeaker: Have feedback on the report? [Share it here](https://about.codecov.io/codecov-pr-comment-feedback/?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=honojs).

<details><summary> :rocket: New features to boost your workflow: </summary>

- :snowflake: [Test Analytics](https://docs.codecov.com/docs/test-analytics): Detect flaky tests, report on failures, and find test suite problems.
- :package: [JS Bundle Analysis](https://docs.codecov.com/docs/javascript-bundle-analysis): Save yourself from yourself by tracking and limiting bundle sizes in JS merges.
</details>
author_association: NONE