From 54b72736b8c363ddb5836ac2723b5172f5cad703 Mon Sep 17 00:00:00 2001 From: AmauryD Date: Wed, 14 Aug 2024 10:04:26 +0200 Subject: [PATCH] fix CI --- .github/workflows/test.yml | 14 +++++++------- packages/http/src/decorators/use-guard.ts | 1 - packages/http/src/decorators/use-middleware.ts | 1 - packages/http/src/index.ts | 1 - .../http/src/storages/metadata/use-middleware.ts | 1 - .../src/storages/metadata/use-response-handler.ts | 1 - packages/http/src/utils/numerical-sort.ts | 1 - packages/http/src/utils/resolve-params.ts | 1 - .../integration/controller-action-storage.test.ts | 2 +- .../src/query/validators/sort.validator.ts | 2 +- .../resource-jsonapi/src/serialization/document.ts | 4 ++-- 11 files changed, 11 insertions(+), 18 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 4a719640..6e620f65 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -18,15 +18,15 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - node-version: [18.x] + node-version: [18.x, 20.x] steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Use Node.js ${{ matrix.node-version }} - uses: actions/setup-node@v3 + uses: actions/setup-node@v4 with: node-version: ${{ matrix.node-version }} - - uses: pnpm/action-setup@v2.2.4 + - uses: pnpm/action-setup@v2 name: Install pnpm id: pnpm-install with: @@ -42,10 +42,10 @@ jobs: runs-on: ubuntu-latest needs: [test] steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Use Node.js - uses: actions/setup-node@v3 - - uses: pnpm/action-setup@v2.2.4 + uses: actions/setup-node@v4 + - uses: pnpm/action-setup@v2 name: Install pnpm id: pnpm-install with: diff --git a/packages/http/src/decorators/use-guard.ts b/packages/http/src/decorators/use-guard.ts index 0c41d597..af120d6f 100644 --- a/packages/http/src/decorators/use-guard.ts +++ b/packages/http/src/decorators/use-guard.ts @@ -1,4 +1,3 @@ - import { container } from '@triptyk/nfw-core'; import type { Class } from 'type-fest'; import type { GuardInterface } from '../interfaces/guard.js'; diff --git a/packages/http/src/decorators/use-middleware.ts b/packages/http/src/decorators/use-middleware.ts index 2993c889..97d35525 100644 --- a/packages/http/src/decorators/use-middleware.ts +++ b/packages/http/src/decorators/use-middleware.ts @@ -1,4 +1,3 @@ - import { container } from '@triptyk/nfw-core'; import type { Class } from 'type-fest'; import { MetadataStorage } from '../storages/metadata-storage.js'; diff --git a/packages/http/src/index.ts b/packages/http/src/index.ts index f8f18423..23990c55 100644 --- a/packages/http/src/index.ts +++ b/packages/http/src/index.ts @@ -1,4 +1,3 @@ - export * from './builders/default.js'; export * from './decorators/verbs.js'; export * from './decorators/controller.js'; diff --git a/packages/http/src/storages/metadata/use-middleware.ts b/packages/http/src/storages/metadata/use-middleware.ts index 675131c7..cc110949 100644 --- a/packages/http/src/storages/metadata/use-middleware.ts +++ b/packages/http/src/storages/metadata/use-middleware.ts @@ -1,4 +1,3 @@ - import type { Class } from 'type-fest'; import type { AnyMiddlewareType } from '../../types/any-middleware.js'; diff --git a/packages/http/src/storages/metadata/use-response-handler.ts b/packages/http/src/storages/metadata/use-response-handler.ts index 141986b5..c51d1948 100644 --- a/packages/http/src/storages/metadata/use-response-handler.ts +++ b/packages/http/src/storages/metadata/use-response-handler.ts @@ -1,4 +1,3 @@ - import type { Class } from 'type-fest'; import type { ResponseHandlerInterface } from '../../interfaces/response-handler.js'; diff --git a/packages/http/src/utils/numerical-sort.ts b/packages/http/src/utils/numerical-sort.ts index 5f7542c2..7e9de22d 100644 --- a/packages/http/src/utils/numerical-sort.ts +++ b/packages/http/src/utils/numerical-sort.ts @@ -1,4 +1,3 @@ - export function numericalSortOnKeyASC> (array : O[], propertyName: keyof O) { return [...array].sort((a, b) => a[propertyName] - b[propertyName]); } diff --git a/packages/http/src/utils/resolve-params.ts b/packages/http/src/utils/resolve-params.ts index 45916b13..d79f8e1e 100644 --- a/packages/http/src/utils/resolve-params.ts +++ b/packages/http/src/utils/resolve-params.ts @@ -1,4 +1,3 @@ - import { ParamResolver } from '../resolvers/param-resolver.js'; import type { UseParamsMetadataArgs } from '../storages/metadata/use-param.js'; import type { ControllerContextType } from '../types/controller-context.js'; diff --git a/packages/http/tests/integration/controller-action-storage.test.ts b/packages/http/tests/integration/controller-action-storage.test.ts index 49891238..c8162b70 100644 --- a/packages/http/tests/integration/controller-action-storage.test.ts +++ b/packages/http/tests/integration/controller-action-storage.test.ts @@ -12,7 +12,7 @@ const rejects = createCustomDecorator(() => Promise.reject(new Error('test')), ' }) class C { @POST('/') - public test (@rejects reject: string) { + public test (@rejects _reject: string) { return 'test'; }; } diff --git a/packages/resource-jsonapi/src/query/validators/sort.validator.ts b/packages/resource-jsonapi/src/query/validators/sort.validator.ts index 62cf288c..0edaa3c5 100644 --- a/packages/resource-jsonapi/src/query/validators/sort.validator.ts +++ b/packages/resource-jsonapi/src/query/validators/sort.validator.ts @@ -24,7 +24,7 @@ export class SortValidator { } } - // eslint-disable-next-line max-statements + // eslint-disable-next-line max-statements, complexity private recursiveSortValidation (sort: SortQuery, field: string, schema: ResourceSchema) { const directionOrSortQuery = sort[field]; diff --git a/packages/resource-jsonapi/src/serialization/document.ts b/packages/resource-jsonapi/src/serialization/document.ts index 76bbb626..ee45ac9b 100644 --- a/packages/resource-jsonapi/src/serialization/document.ts +++ b/packages/resource-jsonapi/src/serialization/document.ts @@ -52,13 +52,13 @@ export class DocumentSerializer { return doc; } - private getSchemaFor(resource: Resource) { + private getSchemaFor (resource: Resource) { if (!resource.resourceType) { throw new Error(`Resource ${resource} has no resourceType assigned`); } try { - return this.registry.getSchemaFor(resource.resourceType); + return this.registry.getSchemaFor(resource.resourceType); } catch (e) { throw new Error(`No schema found for resource type ${resource.resourceType}`); }