From d65cc146f980021c2dd175e2ae77277775e76b80 Mon Sep 17 00:00:00 2001 From: Jonathan Haines Date: Tue, 25 Mar 2025 10:57:15 +1100 Subject: [PATCH] build(auth-js): lint published package (#1034) * build(auth-js): lint published package * ci(auth-js): run publint * build(auth-js): remove no splitting flag --- .github/workflows/ci-auth-js.yml | 1 + packages/auth-js/package.json | 35 +++++++++++++++++--------------- packages/auth-js/tsconfig.json | 4 +--- packages/auth-js/tsup.config.ts | 9 -------- yarn.lock | 5 +++-- 5 files changed, 24 insertions(+), 30 deletions(-) delete mode 100644 packages/auth-js/tsup.config.ts diff --git a/.github/workflows/ci-auth-js.yml b/.github/workflows/ci-auth-js.yml index 0b1f7486..b55c6d2f 100644 --- a/.github/workflows/ci-auth-js.yml +++ b/.github/workflows/ci-auth-js.yml @@ -19,6 +19,7 @@ jobs: node-version: 20.x - run: yarn workspaces focus hono-middleware @hono/auth-js - run: yarn workspace @hono/auth-js build + - run: yarn workspace @hono/auth-js publint - run: yarn test --coverage --project @hono/auth-js - uses: codecov/codecov-action@v5 with: diff --git a/packages/auth-js/package.json b/packages/auth-js/package.json index 822646cc..77c333c0 100644 --- a/packages/auth-js/package.json +++ b/packages/auth-js/package.json @@ -3,25 +3,26 @@ "version": "1.0.15", "description": "A third-party Auth js middleware for Hono", "main": "dist/index.js", + "type": "module", "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" } }, "./react": { "import": { - "types": "./dist/react.d.mts", - "default": "./dist/react.mjs" - }, - "require": { "types": "./dist/react.d.ts", "default": "./dist/react.js" + }, + "require": { + "types": "./dist/react.d.cts", + "default": "./dist/react.cjs" } } }, @@ -36,10 +37,10 @@ "dist" ], "scripts": { - "test": "vitest --run", - "build": "tsup", - "prerelease": "yarn build && yarn test", - "release": "yarn publish" + "build": "tsup src/index.ts src/react.tsx", + "prepack": "yarn build", + "publint": "attw --pack --profile node16 && publint", + "test": "vitest" }, "license": "MIT", "publishConfig": { @@ -48,7 +49,8 @@ }, "repository": { "type": "git", - "url": "https://github.com/honojs/middleware.git" + "url": "git+https://github.com/honojs/middleware.git", + "directory": "packages/auth-js" }, "homepage": "https://github.com/honojs/middleware", "peerDependencies": { @@ -57,15 +59,16 @@ "react": "^18 || ^19 || ^19.0.0-rc" }, "devDependencies": { + "@arethetypeswrong/cli": "^0.17.4", "@auth/core": "^0.35.3", "@types/react": "^18", "hono": "^3.11.7", + "publint": "^0.3.9", "react": "^18.2.0", - "tsup": "^8.0.1", - "typescript": "^5.3.3", + "tsup": "^8.4.0", "vitest": "^3.0.8" }, "engines": { "node": ">=18.4.0" } -} +} \ No newline at end of file diff --git a/packages/auth-js/tsconfig.json b/packages/auth-js/tsconfig.json index c900cc27..550ead33 100644 --- a/packages/auth-js/tsconfig.json +++ b/packages/auth-js/tsconfig.json @@ -4,10 +4,8 @@ "target": "ESNext", "module": "ESNext", "moduleResolution": "node", - "rootDir": "./", "outDir": "./dist", "jsx": "react", "types": ["node", "vitest/globals"] - }, - "include": ["src/**/*.ts", "src/**/*.tsx"] + } } diff --git a/packages/auth-js/tsup.config.ts b/packages/auth-js/tsup.config.ts deleted file mode 100644 index a4fb76eb..00000000 --- a/packages/auth-js/tsup.config.ts +++ /dev/null @@ -1,9 +0,0 @@ -import { defineConfig } from 'tsup' - -export default defineConfig({ - entry: ['src/index.ts', 'src/react.tsx'], - format: ['esm', 'cjs'], - dts: true, - splitting: false, - clean: true, -}) diff --git a/yarn.lock b/yarn.lock index 94f8d7a2..09d078a3 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2600,12 +2600,13 @@ __metadata: version: 0.0.0-use.local resolution: "@hono/auth-js@workspace:packages/auth-js" dependencies: + "@arethetypeswrong/cli": "npm:^0.17.4" "@auth/core": "npm:^0.35.3" "@types/react": "npm:^18" hono: "npm:^3.11.7" + publint: "npm:^0.3.9" react: "npm:^18.2.0" - tsup: "npm:^8.0.1" - typescript: "npm:^5.3.3" + tsup: "npm:^8.4.0" vitest: "npm:^3.0.8" peerDependencies: "@auth/core": 0.*