diff --git a/.github/workflows/ci-medley-router.yml b/.github/workflows/ci-medley-router.yml index c4d46513..1a3003d1 100644 --- a/.github/workflows/ci-medley-router.yml +++ b/.github/workflows/ci-medley-router.yml @@ -19,6 +19,7 @@ jobs: node-version: 18.x - run: yarn workspaces focus hono-middleware @hono/medley-router - run: yarn workspace @hono/medley-router build + - run: yarn workspace @hono/medley-router publint - run: yarn test --coverage --project @hono/medley-router - uses: codecov/codecov-action@v5 with: diff --git a/packages/medley-router/package.json b/packages/medley-router/package.json index 91959fa3..2625f076 100644 --- a/packages/medley-router/package.json +++ b/packages/medley-router/package.json @@ -2,16 +2,30 @@ "name": "@hono/medley-router", "version": "0.0.3", "description": "Router using @medley/router", + "type": "module", "main": "dist/index.js", + "module": "dist/index.js", "types": "dist/index.d.ts", "files": [ "dist" ], "scripts": { - "test": "vitest", - "build": "rimraf dist && tsc", - "prerelease": "yarn build && yarn test", - "release": "yarn publish" + "build": "tsup ./src/index.ts", + "prepack": "yarn build", + "publint": "attw --pack && publint", + "test": "vitest" + }, + "exports": { + ".": { + "import": { + "types": "./dist/index.d.ts", + "default": "./dist/index.js" + }, + "require": { + "types": "./dist/index.d.cts", + "default": "./dist/index.cjs" + } + } }, "license": "MIT", "publishConfig": { @@ -20,15 +34,18 @@ }, "repository": { "type": "git", - "url": "https://github.com/honojs/middleware.git" + "url": "git+https://github.com/honojs/middleware.git", + "directory": "packages/medley-router" }, "homepage": "https://github.com/honojs/middleware", "peerDependencies": { "hono": ">=3.8.0" }, "devDependencies": { + "@arethetypeswrong/cli": "^0.17.4", "hono": "^3.11.7", - "rimraf": "^5.0.5", + "publint": "^0.3.9", + "tsup": "^8.4.0", "vitest": "^3.0.8" }, "dependencies": { diff --git a/packages/medley-router/tsconfig.json b/packages/medley-router/tsconfig.json index af5bfa77..103e4e38 100644 --- a/packages/medley-router/tsconfig.json +++ b/packages/medley-router/tsconfig.json @@ -1,9 +1,7 @@ { "extends": "../../tsconfig.json", "compilerOptions": { - "rootDir": "./src", "outDir": "./dist", "types": ["vitest/globals"] - }, - "include": ["src/**/*.ts"] + } } diff --git a/yarn.lock b/yarn.lock index c0ecceb4..cfae60f4 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2671,9 +2671,11 @@ __metadata: version: 0.0.0-use.local resolution: "@hono/medley-router@workspace:packages/medley-router" dependencies: + "@arethetypeswrong/cli": "npm:^0.17.4" "@medley/router": "npm:^0.2.1" hono: "npm:^3.11.7" - rimraf: "npm:^5.0.5" + publint: "npm:^0.3.9" + tsup: "npm:^8.4.0" vitest: "npm:^3.0.8" peerDependencies: hono: ">=3.8.0"