From cee0c83bc802d4f1b0337955542d2dedc3ace869 Mon Sep 17 00:00:00 2001 From: Jonathan Haines Date: Thu, 27 Mar 2025 17:33:45 +1100 Subject: [PATCH] build(react-compat): lint published package (#1060) --- .github/workflows/ci-react-compat.yml | 30 +++++++++++++++++++++++++++ packages/react-compat/package.json | 17 ++++++++------- packages/react-compat/tsconfig.json | 10 +++------ yarn.lock | 4 +++- 4 files changed, 46 insertions(+), 15 deletions(-) create mode 100644 .github/workflows/ci-react-compat.yml diff --git a/.github/workflows/ci-react-compat.yml b/.github/workflows/ci-react-compat.yml new file mode 100644 index 00000000..4beb43e9 --- /dev/null +++ b/.github/workflows/ci-react-compat.yml @@ -0,0 +1,30 @@ +name: ci-react-compat +on: + push: + branches: [main] + paths: + - 'packages/react-compat/**' + pull_request: + branches: ['*'] + paths: + - 'packages/react-compat/**' + +jobs: + ci: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-node@v4 + with: + node-version: 18.x + - run: yarn workspaces focus hono-middleware @hono/react-compat + - run: yarn workspace @hono/react-compat build + - run: yarn workspace @hono/react-compat publint + # - run: yarn test --coverage --project @hono/react-compat + # - uses: codecov/codecov-action@v5 + # with: + # fail_ci_if_error: true + # directory: ./coverage + # flags: react-compat + # env: + # CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} diff --git a/packages/react-compat/package.json b/packages/react-compat/package.json index 5a9e793a..1dfbee7b 100644 --- a/packages/react-compat/package.json +++ b/packages/react-compat/package.json @@ -6,19 +6,20 @@ "license": "MIT", "module": "dist/index.js", "types": "dist/index.d.ts", + "files": [ + "dist" + ], "scripts": { - "build": "tsup ./src --format esm,cjs --dts", - "publint": "publint", - "release": "yarn build && yarn test && yarn publint && yarn publish" + "build": "tsup ./src", + "prepack": "yarn build", + "publint": "attw --pack && publint" }, "exports": { ".": { - "types": "./dist/index.d.ts", "import": "./dist/index.js", "require": "./dist/index.cjs" }, "./*": { - "types": "./dist/*.d.ts", "import": "./dist/*.js", "require": "./dist/*.cjs" } @@ -27,7 +28,9 @@ "hono": ">=4.5.*" }, "devDependencies": { + "@arethetypeswrong/cli": "^0.17.4", "hono": "^4.5.0", - "tsup": "^8.0.1" + "publint": "^0.3.9", + "tsup": "^8.4.0" } -} +} \ No newline at end of file diff --git a/packages/react-compat/tsconfig.json b/packages/react-compat/tsconfig.json index acfcd843..9f275945 100644 --- a/packages/react-compat/tsconfig.json +++ b/packages/react-compat/tsconfig.json @@ -1,10 +1,6 @@ { "extends": "../../tsconfig.json", "compilerOptions": { - "rootDir": "./src", - "outDir": "./dist", - }, - "include": [ - "src/**/*.ts" - ], -} \ No newline at end of file + "outDir": "./dist" + } +} diff --git a/yarn.lock b/yarn.lock index e6702782..d57285e4 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2305,8 +2305,10 @@ __metadata: version: 0.0.0-use.local resolution: "@hono/react-compat@workspace:packages/react-compat" dependencies: + "@arethetypeswrong/cli": "npm:^0.17.4" hono: "npm:^4.5.0" - tsup: "npm:^8.0.1" + publint: "npm:^0.3.9" + tsup: "npm:^8.4.0" peerDependencies: hono: ">=4.5.*" languageName: unknown