From ddbbbbc07866542c06db4a1ddf1ee5b26e607aea Mon Sep 17 00:00:00 2001 From: Christopher Allford Date: Wed, 24 Jun 2020 14:48:32 -0700 Subject: [PATCH] Adjusted the TypeScript configuration to use the --build flag --- tests/e2e/factories/.gitignore | 1 + .../src/http/axios/axios-api-service.ts | 8 ++++---- tests/e2e/factories/src/index.ts | 2 ++ tests/e2e/factories/tsconfig.json | 12 ++++------- tsconfig.base.json | 20 +++++++++++++++++++ tsconfig.json | 6 ++++++ 6 files changed, 37 insertions(+), 12 deletions(-) create mode 100644 tsconfig.base.json create mode 100644 tsconfig.json diff --git a/tests/e2e/factories/.gitignore b/tests/e2e/factories/.gitignore index 34dac168f2c..1f578929131 100644 --- a/tests/e2e/factories/.gitignore +++ b/tests/e2e/factories/.gitignore @@ -15,3 +15,4 @@ project.properties # Build Artifacts /node_modules/ /dist/ +tsconfig.tsbuildinfo diff --git a/tests/e2e/factories/src/http/axios/axios-api-service.ts b/tests/e2e/factories/src/http/axios/axios-api-service.ts index 63bb42ddb7e..8c1d9e14de1 100644 --- a/tests/e2e/factories/src/http/axios/axios-api-service.ts +++ b/tests/e2e/factories/src/http/axios/axios-api-service.ts @@ -1,13 +1,13 @@ -import { APIResponse, APIError, APIService } from '../api-service'; -import { APIAuthInterceptor } from './api-auth-interceptor'; -import { APIResponseInterceptor } from './api-response-interceptor'; import axios, { AxiosInstance } from 'axios'; +import { APIAuthInterceptor } from './api-auth-interceptor'; +import { APIError, APIResponse, APIService } from '../api-service'; +import { APIResponseInterceptor } from './api-response-interceptor'; /** * An API service implementation that uses Axios to make requests to the WordPress API. */ export class AxiosAPIService implements APIService { - private client: AxiosInstance; + private readonly client: AxiosInstance; private authInterceptor: APIAuthInterceptor; private responseInterceptor: APIResponseInterceptor; diff --git a/tests/e2e/factories/src/index.ts b/tests/e2e/factories/src/index.ts index e69de29bb2d..0b46c864740 100644 --- a/tests/e2e/factories/src/index.ts +++ b/tests/e2e/factories/src/index.ts @@ -0,0 +1,2 @@ +export { APIService, APIResponse, APIError } from './http/api-service'; +export { AxiosAPIService } from './http/axios/axios-api-service'; diff --git a/tests/e2e/factories/tsconfig.json b/tests/e2e/factories/tsconfig.json index 4379bfd36b5..f32d56749ca 100644 --- a/tests/e2e/factories/tsconfig.json +++ b/tests/e2e/factories/tsconfig.json @@ -1,13 +1,9 @@ { + "extends": "../../../tsconfig.base.json", "compilerOptions": { - "incremental": true, - "target": "es5", - "module": "commonjs", "types": [ "node", "jest", "axios", "moxios", "create-hmac" ], - "outDir": "dist", - "declaration": true, - "strict": true, - "esModuleInterop": true + "rootDir": "src", + "outDir": "dist" }, - "include": [ "./src/**/*" ] + "include": [ "src/**/*" ] } diff --git a/tsconfig.base.json b/tsconfig.base.json new file mode 100644 index 00000000000..0ea700b4018 --- /dev/null +++ b/tsconfig.base.json @@ -0,0 +1,20 @@ +{ + "compilerOptions": { + "target": "es5", + "module": "commonjs", + "incremental": true, + "allowJs": true, + "checkJs": true, + "allowSyntheticDefaultImports": true, + "esModuleInterop": true, + "declaration": true, + "composite": true, + "strict": true, + "strictNullChecks": true, + "noImplicitAny": true, + "noUnusedLocals": true, + "noUnusedParameters": true, + "noImplicitReturns": true, + "noFallthroughCasesInSwitch": true + } +} diff --git a/tsconfig.json b/tsconfig.json new file mode 100644 index 00000000000..5ce3f73bb9b --- /dev/null +++ b/tsconfig.json @@ -0,0 +1,6 @@ +{ + "references": [ + { "path": "tests/e2e/factories" } + ], + "files": [] +}