Adjusted the TypeScript configuration to use the --build flag

This commit is contained in:
Christopher Allford 2020-06-24 14:48:32 -07:00
parent 6ad8b57f2e
commit ddbbbbc078
6 changed files with 37 additions and 12 deletions

View File

@ -15,3 +15,4 @@ project.properties
# Build Artifacts # Build Artifacts
/node_modules/ /node_modules/
/dist/ /dist/
tsconfig.tsbuildinfo

View File

@ -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 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. * An API service implementation that uses Axios to make requests to the WordPress API.
*/ */
export class AxiosAPIService implements APIService { export class AxiosAPIService implements APIService {
private client: AxiosInstance; private readonly client: AxiosInstance;
private authInterceptor: APIAuthInterceptor; private authInterceptor: APIAuthInterceptor;
private responseInterceptor: APIResponseInterceptor; private responseInterceptor: APIResponseInterceptor;

View File

@ -0,0 +1,2 @@
export { APIService, APIResponse, APIError } from './http/api-service';
export { AxiosAPIService } from './http/axios/axios-api-service';

View File

@ -1,13 +1,9 @@
{ {
"extends": "../../../tsconfig.base.json",
"compilerOptions": { "compilerOptions": {
"incremental": true,
"target": "es5",
"module": "commonjs",
"types": [ "node", "jest", "axios", "moxios", "create-hmac" ], "types": [ "node", "jest", "axios", "moxios", "create-hmac" ],
"outDir": "dist", "rootDir": "src",
"declaration": true, "outDir": "dist"
"strict": true,
"esModuleInterop": true
}, },
"include": [ "./src/**/*" ] "include": [ "src/**/*" ]
} }

20
tsconfig.base.json Normal file
View File

@ -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
}
}

6
tsconfig.json Normal file
View File

@ -0,0 +1,6 @@
{
"references": [
{ "path": "tests/e2e/factories" }
],
"files": []
}