From 9ded1af5b00056fa470becb011910004b8bc71e6 Mon Sep 17 00:00:00 2001 From: fengmk2 Date: Wed, 19 Jun 2024 10:28:42 +0800 Subject: [PATCH] fix: use @arethetypeswrong/cli to auto add source exports (#43) https://github.com/eggjs/egg/issues/5257#issuecomment-2176524639 --- .github/workflows/nodejs.yml | 5 +++-- .github/workflows/release.yml | 2 -- package.json | 7 ++++++- 3 files changed, 9 insertions(+), 5 deletions(-) diff --git a/.github/workflows/nodejs.yml b/.github/workflows/nodejs.yml index e807d60..5806d09 100644 --- a/.github/workflows/nodejs.yml +++ b/.github/workflows/nodejs.yml @@ -3,7 +3,6 @@ name: CI on: push: branches: [ master ] - pull_request: branches: [ master ] @@ -13,4 +12,6 @@ jobs: uses: node-modules/github-actions/.github/workflows/node-test.yml@master with: os: 'ubuntu-latest, macos-latest' - version: '16, 18, 20' + version: '16, 18, 20, 22' + secrets: + CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index a4e1158..1c6cbb1 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -11,5 +11,3 @@ jobs: secrets: NPM_TOKEN: ${{ secrets.NPM_TOKEN }} GIT_TOKEN: ${{ secrets.GIT_TOKEN }} - with: - checkTest: false diff --git a/package.json b/package.json index 78571a6..7f894c6 100644 --- a/package.json +++ b/package.json @@ -6,12 +6,13 @@ "lint": "eslint src test --ext .ts", "pretest": "npm run lint -- --fix && npm run prepublishOnly", "test": "egg-bin test", - "preci": "npm run prepublishOnly", + "preci": "npm run lint && npm run prepublishOnly && attw --pack --ignore-rules no-resolution", "ci": "egg-bin cov", "contributor": "git-contributor", "prepublishOnly": "tshy && tshy-after" }, "devDependencies": { + "@arethetypeswrong/cli": "*", "@eggjs/tsconfig": "^1.3.3", "@types/mocha": "^10.0.1", "@types/node": "^20.6.3", @@ -56,20 +57,24 @@ "./package.json": "./package.json", "./promises": { "import": { + "source": "./src/promises.ts", "types": "./dist/esm/promises.d.ts", "default": "./dist/esm/promises.js" }, "require": { + "source": "./src/promises.ts", "types": "./dist/commonjs/promises.d.ts", "default": "./dist/commonjs/promises.js" } }, ".": { "import": { + "source": "./src/index.ts", "types": "./dist/esm/index.d.ts", "default": "./dist/esm/index.js" }, "require": { + "source": "./src/index.ts", "types": "./dist/commonjs/index.d.ts", "default": "./dist/commonjs/index.js" }