Repository: honojs/middleware
Pull request #1053: build(oauth-providers): lint published package
Author: login: BarryThePenguin
Created: 2025-03-26T21:53:37Z | Merged: 2025-03-27T02:30:17Z



Diff:
diff --git a/.github/workflows/ci-oauth-providers.yml b/.github/workflows/ci-oauth-providers.yml
index 8c87cf000..b286d5851 100644
--- a/.github/workflows/ci-oauth-providers.yml
+++ b/.github/workflows/ci-oauth-providers.yml
@@ -19,6 +19,7 @@ jobs:
           node-version: 20.x
       - run: yarn workspaces focus hono-middleware @hono/oauth-providers
       - run: yarn workspace @hono/oauth-providers build
+      - run: yarn workspace @hono/oauth-providers publint
       - run: yarn test --coverage --project @hono/oauth-providers
       - uses: codecov/codecov-action@v5
         with:
diff --git a/packages/oauth-providers/package.json b/packages/oauth-providers/package.json
index 7be1ad20c..2fbf87573 100644
--- a/packages/oauth-providers/package.json
+++ b/packages/oauth-providers/package.json
@@ -2,96 +2,38 @@
   "name": "@hono/oauth-providers",
   "version": "0.7.0",
   "description": "Social login for Hono JS, integrate authentication with facebook, github, google and linkedin to your projects.",
+  "type": "module",
   "main": "dist/index.js",
+  "module": "dist/index.js",
+  "types": "dist/index.d.ts",
   "files": [
     "./dist"
   ],
   "scripts": {
-    "test": "vitest",
-    "build": "tsup && publint",
-    "watch": "tsup --watch",
-    "publint": "publint",
-    "release": "yarn build && yarn test && yarn publint && yarn publish"
+    "build": "tsup ./src/index.ts ./src/providers/**/index.ts ./src/providers/**/types.ts --no-splitting",
+    "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"
-      }
-    },
-    "./google": {
-      "import": {
-        "types": "./dist/providers/google/index.d.mts",
-        "default": "./dist/providers/google/index.mjs"
-      },
-      "require": {
-        "types": "./dist/providers/google/index.d.ts",
-        "default": "./dist/providers/google/index.js"
-      }
-    },
-    "./facebook": {
-      "import": {
-        "types": "./dist/providers/facebook/index.d.mts",
-        "default": "./dist/providers/facebook/index.mjs"
-      },
-      "require": {
-        "types": "./dist/providers/facebook/index.d.ts",
-        "default": "./dist/providers/facebook/index.js"
-      }
-    },
-    "./github": {
-      "import": {
-        "types": "./dist/providers/github/index.d.mts",
-        "default": "./dist/providers/github/index.mjs"
-      },
-      "require": {
-        "types": "./dist/providers/github/index.d.ts",
-        "default": "./dist/providers/github/index.js"
-      }
-    },
-    "./linkedin": {
-      "import": {
-        "types": "./dist/providers/linkedin/index.d.mts",
-        "default": "./dist/providers/linkedin/index.mjs"
-      },
-      "require": {
-        "types": "./dist/providers/linkedin/index.d.ts",
-        "default": "./dist/providers/linkedin/index.js"
-      }
-    },
-    "./x": {
-      "import": {
-        "types": "./dist/providers/x/index.d.mts",
-        "default": "./dist/providers/x/index.mjs"
-      },
-      "require": {
-        "types": "./dist/providers/x/index.d.ts",
-        "default": "./dist/providers/x/index.js"
-      }
-    },
-    "./discord": {
-      "import": {
-        "types": "./dist/providers/discord/index.d.mts",
-        "default": "./dist/providers/discord/index.mjs"
       },
       "require": {
-        "types": "./dist/providers/discord/index.d.ts",
-        "default": "./dist/providers/discord/index.js"
+        "types": "./dist/index.d.cts",
+        "default": "./dist/index.cjs"
       }
     },
-    "./twitch": {
+    "./*": {
       "import": {
-        "types": "./dist/providers/twitch/index.d.mts",
-        "default": "./dist/providers/twitch/index.mjs"
+        "types": "./dist/providers/*/index.d.ts",
+        "default": "./dist/providers/*/index.js"
       },
       "require": {
-        "types": "./dist/providers/twitch/index.d.ts",
-        "default": "./dist/providers/twitch/index.js"
+        "types": "./dist/providers/*/index.d.cts",
+        "default": "./dist/providers/*/index.cjs"
       }
     }
   },
@@ -124,16 +66,14 @@
     "hono": ">=3.*"
   },
   "devDependencies": {
-    "@cloudflare/workers-types": "^4.20231025.0",
+    "@arethetypeswrong/cli": "^0.17.4",
     "hono": "^4.5.1",
     "msw": "^2.0.11",
-    "patch-package": "^8.0.0",
-    "publint": "^0.2.6",
-    "tsup": "^8.0.0",
-    "typescript": "^5.2.2",
+    "publint": "^0.3.9",
+    "tsup": "^8.4.0",
     "vitest": "^3.0.8"
   },
   "engines": {
     "node": ">=18.4.0"
   }
-}
+}
\ No newline at end of file
diff --git a/packages/oauth-providers/tsconfig.json b/packages/oauth-providers/tsconfig.json
index af5bfa77a..103e4e38c 100644
--- a/packages/oauth-providers/tsconfig.json
+++ b/packages/oauth-providers/tsconfig.json
@@ -1,9 +1,7 @@
 {
   "extends": "../../tsconfig.json",
   "compilerOptions": {
-    "rootDir": "./src",
     "outDir": "./dist",
     "types": ["vitest/globals"]
-  },
-  "include": ["src/**/*.ts"]
+  }
 }
diff --git a/packages/oauth-providers/tsup.config.ts b/packages/oauth-providers/tsup.config.ts
deleted file mode 100644
index 146d6e33d..000000000
--- a/packages/oauth-providers/tsup.config.ts
+++ /dev/null
@@ -1,9 +0,0 @@
-import { defineConfig } from 'tsup'
-
-export default defineConfig({
-  entry: ['src/index.ts', 'src/providers/**/index.ts', 'src/providers/**/types.ts'],
-  format: ['esm', 'cjs'],
-  dts: true,
-  splitting: false,
-  clean: true,
-})
diff --git a/yarn.lock b/yarn.lock
index 09d078a3e..25cef5cbd 100644
--- a/yarn.lock
+++ b/yarn.lock
@@ -2873,13 +2873,13 @@ __metadata:
   version: 0.0.0-use.local
   resolution: "@hono/oauth-providers@workspace:packages/oauth-providers"
   dependencies:
+    "@arethetypeswrong/cli": "npm:^0.17.4"
     "@cloudflare/workers-types": "npm:^4.20231025.0"
     hono: "npm:^4.5.1"
     msw: "npm:^2.0.11"
     patch-package: "npm:^8.0.0"
-    publint: "npm:^0.2.6"
-    tsup: "npm:^8.0.0"
-    typescript: "npm:^5.2.2"
+    publint: "npm:^0.3.9"
+    tsup: "npm:^8.4.0"
     vitest: "npm:^3.0.8"
   peerDependencies:
     hono: ">=3.*"
@@ -15833,7 +15833,7 @@ __metadata:
   languageName: node
   linkType: hard
 
-"publint@npm:^0.2.2, publint@npm:^0.2.6":
+"publint@npm:^0.2.2":
   version: 0.2.6
   resolution: "publint@npm:0.2.6"
   dependencies:
@@ -18568,7 +18568,7 @@ __metadata:
   languageName: node
   linkType: hard
 
-"tsup@npm:^8.0.0, tsup@npm:^8.0.1":
+"tsup@npm:^8.0.1":
   version: 8.0.1
   resolution: "tsup@npm:8.0.1"
   dependencies:


Reviews:
user: login: BarryThePenguin
state: COMMENTED
author_association: CONTRIBUTOR
submitted_at: 2025-03-26T21:56:09Z
user: login: yusukebe
state: COMMENTED
author_association: MEMBER
submitted_at: 2025-03-27T02:29:55Z
user: login: yusukebe
body: LGTM!
state: APPROVED
author_association: MEMBER
submitted_at: 2025-03-27T02:30:07Z

Review comments:
diff_hunk: @@ -2,96 +2,38 @@
   "name": "@hono/oauth-providers",
   "version": "0.7.0",
   "description": "Social login for Hono JS, integrate authentication with facebook, github, google and linkedin to your projects.",
+  "type": "module",
   "main": "dist/index.js",
+  "module": "dist/index.js",
+  "types": "dist/index.d.ts",
   "files": [
     "./dist"
   ],
   "scripts": {
-    "test": "vitest",
-    "build": "tsup && publint",
-    "watch": "tsup --watch",
-    "publint": "publint",
-    "release": "yarn build && yarn test && yarn publint && yarn publish"
+    "build": "tsup ./src/index.ts ./src/providers/**/index.ts ./src/providers/**/types.ts --no-splitting",
+    "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"
-      }
-    },
-    "./google": {
-      "import": {
-        "types": "./dist/providers/google/index.d.mts",
-        "default": "./dist/providers/google/index.mjs"
-      },
-      "require": {
-        "types": "./dist/providers/google/index.d.ts",
-        "default": "./dist/providers/google/index.js"
-      }
-    },
-    "./facebook": {
-      "import": {
-        "types": "./dist/providers/facebook/index.d.mts",
-        "default": "./dist/providers/facebook/index.mjs"
-      },
-      "require": {
-        "types": "./dist/providers/facebook/index.d.ts",
-        "default": "./dist/providers/facebook/index.js"
-      }
-    },
-    "./github": {
-      "import": {
-        "types": "./dist/providers/github/index.d.mts",
-        "default": "./dist/providers/github/index.mjs"
-      },
-      "require": {
-        "types": "./dist/providers/github/index.d.ts",
-        "default": "./dist/providers/github/index.js"
-      }
-    },
-    "./linkedin": {
-      "import": {
-        "types": "./dist/providers/linkedin/index.d.mts",
-        "default": "./dist/providers/linkedin/index.mjs"
-      },
-      "require": {
-        "types": "./dist/providers/linkedin/index.d.ts",
-        "default": "./dist/providers/linkedin/index.js"
-      }
-    },
-    "./x": {
-      "import": {
-        "types": "./dist/providers/x/index.d.mts",
-        "default": "./dist/providers/x/index.mjs"
-      },
-      "require": {
-        "types": "./dist/providers/x/index.d.ts",
-        "default": "./dist/providers/x/index.js"
-      }
-    },
-    "./discord": {
-      "import": {
-        "types": "./dist/providers/discord/index.d.mts",
-        "default": "./dist/providers/discord/index.mjs"
       },
       "require": {
-        "types": "./dist/providers/discord/index.d.ts",
-        "default": "./dist/providers/discord/index.js"
+        "types": "./dist/index.d.cts",
+        "default": "./dist/index.cjs"
       }
     },
-    "./twitch": {
+    "./*": {
path: packages/oauth-providers/package.json
user: login: BarryThePenguin
body: I also reduced all the seperate providers `exports` into a single [subpath pattern](https://nodejs.org/docs/latest-v18.x/api/packages.html#subpath-patterns), hopefully that makes it a little easier to add new providers in the future
created_at: 2025-03-26T21:56:09Z
author_association: CONTRIBUTOR
diff_hunk: @@ -2,96 +2,38 @@
   "name": "@hono/oauth-providers",
   "version": "0.7.0",
   "description": "Social login for Hono JS, integrate authentication with facebook, github, google and linkedin to your projects.",
+  "type": "module",
   "main": "dist/index.js",
+  "module": "dist/index.js",
+  "types": "dist/index.d.ts",
   "files": [
     "./dist"
   ],
   "scripts": {
-    "test": "vitest",
-    "build": "tsup && publint",
-    "watch": "tsup --watch",
-    "publint": "publint",
-    "release": "yarn build && yarn test && yarn publint && yarn publish"
+    "build": "tsup ./src/index.ts ./src/providers/**/index.ts ./src/providers/**/types.ts --no-splitting",
+    "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"
-      }
-    },
-    "./google": {
-      "import": {
-        "types": "./dist/providers/google/index.d.mts",
-        "default": "./dist/providers/google/index.mjs"
-      },
-      "require": {
-        "types": "./dist/providers/google/index.d.ts",
-        "default": "./dist/providers/google/index.js"
-      }
-    },
-    "./facebook": {
-      "import": {
-        "types": "./dist/providers/facebook/index.d.mts",
-        "default": "./dist/providers/facebook/index.mjs"
-      },
-      "require": {
-        "types": "./dist/providers/facebook/index.d.ts",
-        "default": "./dist/providers/facebook/index.js"
-      }
-    },
-    "./github": {
-      "import": {
-        "types": "./dist/providers/github/index.d.mts",
-        "default": "./dist/providers/github/index.mjs"
-      },
-      "require": {
-        "types": "./dist/providers/github/index.d.ts",
-        "default": "./dist/providers/github/index.js"
-      }
-    },
-    "./linkedin": {
-      "import": {
-        "types": "./dist/providers/linkedin/index.d.mts",
-        "default": "./dist/providers/linkedin/index.mjs"
-      },
-      "require": {
-        "types": "./dist/providers/linkedin/index.d.ts",
-        "default": "./dist/providers/linkedin/index.js"
-      }
-    },
-    "./x": {
-      "import": {
-        "types": "./dist/providers/x/index.d.mts",
-        "default": "./dist/providers/x/index.mjs"
-      },
-      "require": {
-        "types": "./dist/providers/x/index.d.ts",
-        "default": "./dist/providers/x/index.js"
-      }
-    },
-    "./discord": {
-      "import": {
-        "types": "./dist/providers/discord/index.d.mts",
-        "default": "./dist/providers/discord/index.mjs"
       },
       "require": {
-        "types": "./dist/providers/discord/index.d.ts",
-        "default": "./dist/providers/discord/index.js"
+        "types": "./dist/index.d.cts",
+        "default": "./dist/index.cjs"
       }
     },
-    "./twitch": {
+    "./*": {
path: packages/oauth-providers/package.json
user: login: yusukebe
body: I've confirmed that this works well. Thanks!
created_at: 2025-03-27T02:29:55Z
author_association: MEMBER

PR comments:
user: login: changeset-bot[bot]
created_at: 2025-03-26T21:53:39Z
body: ###  ⚠️  No Changeset found

Latest commit: db0a16df4ef3626ae270519199960ba0fb097c83

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/oauth-providers?filename=.changeset/shy-doors-promise.md&value=---%0A%22%40hono%2Foauth-providers%22%3A%20patch%0A---%0A%0Abuild(oauth-providers)%3A%20lint%20published%20package%0A)


author_association: NONE
user: login: codecov-commenter
created_at: 2025-03-26T21:55:22Z
body: ## [Codecov](https://app.codecov.io/gh/honojs/middleware/pull/1053?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 [(`db0a16d`)](https://app.codecov.io/gh/honojs/middleware/commit/db0a16df4ef3626ae270519199960ba0fb097c83?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=honojs).

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


```diff
@@           Coverage Diff           @@
##             main    #1053   +/-   ##
=======================================
  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/1053/flags?src=pr&el=flags&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=honojs) | Coverage Δ | |
|---|---|---|
| [oauth-providers](https://app.codecov.io/gh/honojs/middleware/pull/1053/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=honojs) | `22.24% <ø> (-0.04%)` | :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/1053?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