From fcce865c875974bad1b2b24dc527c5005fe181df Mon Sep 17 00:00:00 2001 From: Jonathan Haines Date: Thu, 27 Mar 2025 13:30:17 +1100 Subject: [PATCH] build(oauth-providers): lint published package (#1053) --- .github/workflows/ci-oauth-providers.yml | 1 + packages/oauth-providers/package.json | 96 +++++------------------- packages/oauth-providers/tsconfig.json | 4 +- packages/oauth-providers/tsup.config.ts | 9 --- yarn.lock | 10 +-- 5 files changed, 25 insertions(+), 95 deletions(-) delete mode 100644 packages/oauth-providers/tsup.config.ts diff --git a/.github/workflows/ci-oauth-providers.yml b/.github/workflows/ci-oauth-providers.yml index 8c87cf00..b286d585 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 07cf341a..d4980885 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" + "types": "./dist/index.d.cts", + "default": "./dist/index.cjs" } }, - "./facebook": { + "./*": { "import": { - "types": "./dist/providers/facebook/index.d.mts", - "default": "./dist/providers/facebook/index.mjs" + "types": "./dist/providers/*/index.d.ts", + "default": "./dist/providers/*/index.js" }, "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" - } - }, - "./twitch": { - "import": { - "types": "./dist/providers/twitch/index.d.mts", - "default": "./dist/providers/twitch/index.mjs" - }, - "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" } }, "./msentra": { @@ -137,16 +79,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 af5bfa77..103e4e38 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 146d6e33..00000000 --- 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 2ab858b0..c610c1e8 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2712,13 +2712,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.*" @@ -14291,7 +14291,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: @@ -16747,7 +16747,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: