From 4fdbd919a3843245e0b80d5da0e9df9b64fa508d Mon Sep 17 00:00:00 2001 From: Fil Maj Date: Thu, 24 Aug 2023 14:07:02 -0400 Subject: [PATCH] Remove Lerna and related root npm run scripts, fix types in rtm-api, only test against node 18 and 20 (#1649) --- .github/workflows/ci-build.yml | 30 +++++++++++++++--------------- package.json | 10 ++-------- packages/rtm-api/src/KeepAlive.ts | 4 ++-- 3 files changed, 19 insertions(+), 25 deletions(-) diff --git a/.github/workflows/ci-build.yml b/.github/workflows/ci-build.yml index 4c77e1caa..9b32bfff9 100644 --- a/.github/workflows/ci-build.yml +++ b/.github/workflows/ci-build.yml @@ -1,31 +1,31 @@ -# This workflow will do a clean install of node dependencies, build the source code and run tests across different versions of node -# For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions - -name: Node.js CI +name: Node.js Build and Test on: push: branches: - main pull_request: - + jobs: build: - runs-on: ubuntu-latest timeout-minutes: 10 - strategy: matrix: - node-version: [14.x, 16.x, 18.x, 20.x] - + node-version: [18.x, 20.x] steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - name: Use Node.js ${{ matrix.node-version }} - uses: actions/setup-node@v1 + uses: actions/setup-node@v3 with: node-version: ${{ matrix.node-version }} - - run: npm install - - run: npm run setup - - run: npm run test - # - run: npm run coverage + - name: Get Development Dependencies + run: npm i + - name: Build and Run Tests in Each Package + run: | + for pkg in packages/logger packages/oauth packages/rtm-api packages/socket-mode packages/types packages/web-api packages/webhook; do + pushd ${pkg} + npm install || npm list + npm test + popd + done diff --git a/package.json b/package.json index 16b3ae25e..d56b46b18 100644 --- a/package.json +++ b/package.json @@ -1,13 +1,7 @@ { - "scripts": { - "test": "lerna run test", - "lint": "lerna run lint", - "setup": "lerna bootstrap --no-ci --hoist", - "ref-docs": "lerna run ref-docs:model --no-bail; lerna run start --scope @slack/sdk-ref-docs" - }, + "name": "node-slack-sdk", "devDependencies": { "eslint": "^7.32.0", - "eslint-plugin-jsdoc": "^30.6.1", - "lerna": "^5.5.0" + "eslint-plugin-jsdoc": "^30.6.1" } } diff --git a/packages/rtm-api/src/KeepAlive.ts b/packages/rtm-api/src/KeepAlive.ts index 9c0230b2c..079ce46fa 100644 --- a/packages/rtm-api/src/KeepAlive.ts +++ b/packages/rtm-api/src/KeepAlive.ts @@ -39,12 +39,12 @@ export class KeepAlive extends EventEmitter { /** * A timer for when to send the next ping if no other outgoing message is sent. */ - private pingTimer?: NodeJS.Timer; + private pingTimer?: NodeJS.Timeout; /** * A timer for when to stop listening for an incoming event that acknowledges the ping (counts as a pong) */ - private pongTimer?: NodeJS.Timer; + private pongTimer?: NodeJS.Timeout; /** * The message ID of the latest ping sent, or undefined is there hasn't been one sent.