From 2d074d51e694602766b1b163528e31420cb40219 Mon Sep 17 00:00:00 2001 From: deskoh Date: Sun, 1 Mar 2020 10:49:02 +0800 Subject: [PATCH 1/3] Updated typings for express middleware --- packages/express/index.d.ts | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/packages/express/index.d.ts b/packages/express/index.d.ts index 97bdc40652..05d329d7a2 100644 --- a/packages/express/index.d.ts +++ b/packages/express/index.d.ts @@ -1,4 +1,4 @@ -import { Application as FeathersApplication, Params as FeathersParams, HookContext } from '@feathersjs/feathers'; +import { Application as FeathersApplication, Params as FeathersParams, HookContext, SetupMethod, ServiceMethods } from '@feathersjs/feathers'; import express from 'express'; declare const feathersExpress: FeathersExpress; @@ -47,4 +47,14 @@ declare module 'express-serve-static-core' { data?: any; hook?: HookContext; } + + type FeathersService = Partial & SetupMethod>; + + interface IRouterMatcher { + // tslint:disable-next-line callable-types (Required for declaration merging) +

( + path: PathParams, + ...handlers: (RequestHandler | FeathersService | Application)[] + ): T; + } } From 9d7bfe5740fd04641c0a0d48608904a0cca72ad5 Mon Sep 17 00:00:00 2001 From: David Luecke Date: Tue, 3 Mar 2020 16:28:37 -0800 Subject: [PATCH 2/3] Try to run Codeclimate conditionally --- .github/workflows/nodejs.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/nodejs.yml b/.github/workflows/nodejs.yml index b3f3a4cbfb..31496c1428 100644 --- a/.github/workflows/nodejs.yml +++ b/.github/workflows/nodejs.yml @@ -23,5 +23,6 @@ jobs: env: CI: true - run: codeclimate-test-reporter < coverage/lcov.info + if: secrets.codeclimate env: CODECLIMATE_REPO_TOKEN: ${{ secrets.codeclimate }} From 1d503fa68346ab2d180421c59913af2e7eaf33b0 Mon Sep 17 00:00:00 2001 From: David Luecke Date: Tue, 3 Mar 2020 16:30:13 -0800 Subject: [PATCH 3/3] Wrap Codeclimate command in if --- .github/workflows/nodejs.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/nodejs.yml b/.github/workflows/nodejs.yml index 31496c1428..72fda23bd8 100644 --- a/.github/workflows/nodejs.yml +++ b/.github/workflows/nodejs.yml @@ -22,7 +22,9 @@ jobs: - run: npm test env: CI: true - - run: codeclimate-test-reporter < coverage/lcov.info - if: secrets.codeclimate + - run: | + if [ "$CODECLIMATE_REPO_TOKEN" != "" ]; then + codeclimate-test-reporter < coverage/lcov.info + fi env: CODECLIMATE_REPO_TOKEN: ${{ secrets.codeclimate }}