Skip to content

Commit

Permalink
feat: update npm dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
ruscon committed Nov 15, 2021
1 parent acb734e commit 3ab1f87
Show file tree
Hide file tree
Showing 32 changed files with 93 additions and 83 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ jobs:
strategy:
fail-fast: false
matrix:
node-version: [12, 14]
node-version: [12, 14, 16]

steps:
- name: Clone repository
Expand All @@ -99,6 +99,6 @@ jobs:

- name: Coveralls
uses: coverallsapp/github-action@master
if: startsWith(matrix.node-version, '14')
if: startsWith(matrix.node-version, '16')
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v14
v16
24 changes: 12 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,9 @@ In the code snippet below we use Google provider.
```typescript
import 'reflect-metadata';
import { Distance, Location, Geocoder, GoogleMapsProvider, Suggestion } from '@goparrot/geocoder';
import Axios, { AxiosInstance } from 'axios';
import axios, { AxiosInstance } from 'axios';

const axios: AxiosInstance = Axios.create();
const axios: AxiosInstance = axios.create();

const provider: GoogleMapsProvider = new GoogleMapsProvider(axios, 'YOUR_API_KEY');

Expand Down Expand Up @@ -119,13 +119,13 @@ In the code snippet below we use Here provider.
```typescript
import 'reflect-metadata';
import { Location, Geocoder, HereProvider, LoggerInterface } from '@goparrot/geocoder';
import Axios, { AxiosInstance, AxiosRequestConfig, AxiosResponse } from 'axios';
import axios, { AxiosInstance, AxiosRequestConfig, AxiosResponse } from 'axios';

// You can use any logger that fits the LoggerInterface
const logger: LoggerInterface = console;

// Set timeout for all requests
const axios: AxiosInstance = Axios.create({
const axios: AxiosInstance = axios.create({
timeout: 5000,
});

Expand Down Expand Up @@ -169,7 +169,7 @@ geocoder.setLogger(logger);
withRaw: true, // default false
});

logger.info('locations', locations);
logger.info('locations', { locations });
} catch (err) {
logger.error(err);
}
Expand All @@ -185,7 +185,7 @@ geocoder.setLogger(logger);
// withRaw: false, // default
});

console.info('locations', locations);
console.info('locations', { locations });
} catch (err) {
console.error(err);
}
Expand Down Expand Up @@ -235,10 +235,10 @@ when a provider returns a result.

```typescript
import 'reflect-metadata';
import Axios, { AxiosInstance } from 'axios';
import axios, { AxiosInstance } from 'axios';
import { Location, ChainProvider, HereProvider, MapQuestProvider, ProviderAggregator } from '@goparrot/geocoder';

const axios: AxiosInstance = Axios.create({
const axios: AxiosInstance = axios.create({
timeout: 5000,
});

Expand All @@ -252,7 +252,7 @@ const geocoder: ProviderAggregator = new ProviderAggregator([chainProvider]);
address: '1158 E 89th St, Chicago, IL 60619, USA',
});

console.info(locations);
console.info({ locations });
} catch (err) {
console.error(err);
}
Expand All @@ -266,10 +266,10 @@ manualy decide which provider to use later on.

```typescript
import 'reflect-metadata';
import Axios, { AxiosInstance } from 'axios';
import axios, { AxiosInstance } from 'axios';
import { Location, GoogleMapsProvider, HereProvider, ProviderAggregator, MapQuestProvider } from '@goparrot/geocoder';

const axios: AxiosInstance = Axios.create({
const axios: AxiosInstance = axios.create({
timeout: 5000,
});

Expand All @@ -286,7 +286,7 @@ geocoder.registerProvider(new GoogleMapsProvider(axios, 'YOUR_API_KEY'));
address: '1158 E 89th St, Chicago, IL 60619, USA',
});

console.info(locations);
console.info({ locations });
} catch (err) {
console.error(err);
}
Expand Down
28 changes: 15 additions & 13 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -102,43 +102,45 @@
"world-countries": "^4.0.0"
},
"devDependencies": {
"@commitlint/cli": "^13.2.1",
"@commitlint/config-conventional": "^13.2.0",
"@commitlint/travis-cli": "^13.2.1",
"@commitlint/cli": "^14.1.0",
"@commitlint/config-conventional": "^14.1.0",
"@commitlint/travis-cli": "^14.1.0",
"@goparrot/eslint-config": "^1.0.1",
"@types/chai": "^4.2.15",
"@types/chai-as-promised": "^7.1.3",
"@types/lodash.isempty": "^4.4.6",
"@types/mocha": "^9.0.0",
"@types/node": "^16.11.0",
"@types/sinon": "^10.0.0",
"@types/node": "^16.11.7",
"@types/semver": "^7.3.9",
"@types/sinon": "^10.0.6",
"@types/supertest": "^2.0.10",
"axios": "^0.21.1",
"axios": "^0.24.0",
"axios-mock-adapter": "^1.19.0",
"chai": "^4.3.3",
"chai-as-promised": "^7.1.1",
"commitizen": "^4.2.3",
"conventional-github-releaser": "^3.1.5",
"dotenv": "^10.0.0",
"husky": "^7.0.2",
"lint-staged": "^11.0.0",
"husky": "^7.0.4",
"lint-staged": "^12.0.2",
"mocha": "^9.1.3",
"mocha-junit-reporter": "^2.0.0",
"npm-run-all": "^4.1.5",
"nyc": "^15.1.0",
"prettier": "^2.2.1",
"reflect-metadata": ">=0.1.13",
"remark-cli": "^10.0.0",
"remark-frontmatter": "^4.0.0",
"remark-github": "^11.1.0",
"remark-frontmatter": "^4.0.1",
"remark-github": "^11.2.2",
"remark-lint-emphasis-marker": "^3.1.0",
"remark-lint-strong-marker": "^3.1.0",
"rimraf": "^3.0.2",
"sinon": "^11.1.2",
"semver": "^7.3.5",
"sinon": "^12.0.1",
"source-map-support": "^0.5.19",
"standard-version": "^9.1.1",
"standard-version": "^9.3.2",
"supertest": "^6.1.3",
"ts-node": "^10.3.0",
"ts-node": "^10.4.0",
"tsconfig-paths": "^3.9.0",
"typescript": "^4.4.4"
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ export class HereSuggestionTransformer extends AbstractSuggestionTransformer<Her
}

async getFormattedAddress(): Promise<string> {
return this.getLocationAddress().Label!;
return this.getLocationAddress().Label ?? '';
}

async getPlaceId(): Promise<string> {
Expand Down
4 changes: 2 additions & 2 deletions test/e2e/common/shared.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import Axios from 'axios';
import axios from 'axios';
import type { AxiosInstance } from 'axios';
import type MockAdapter from 'axios-mock-adapter';
import {
Expand Down Expand Up @@ -185,7 +185,7 @@ export function sharedAccuracyBehaviours(

export function sharedProvidableBehaviours(providableClass: Type<ProviderInterface & ProvidableInterface & LoggableInterface>): void {
describe('#sharedProvidableBehaviours', () => {
const client: AxiosInstance = Axios.create();
const client: AxiosInstance = axios.create();
const googleProvider: GoogleMapsProvider = new GoogleMapsProvider(client, 'test');

let provider: ProviderInterface & ProvidableInterface & LoggableInterface;
Expand Down
4 changes: 2 additions & 2 deletions test/e2e/geocoder/geocoder.spec.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import Axios from 'axios';
import axios from 'axios';
import MockAdapter from 'axios-mock-adapter';
import type { AxiosInstance } from 'axios';
import { Geocoder } from '../../../src/geocoder';
Expand All @@ -18,7 +18,7 @@ import { sharedAccuracyBehaviours, sharedCommandBehaviours } from '../common/sha
import type { QueryInterface } from '../../../src/interface';

describe('Geocoder (2e2)', () => {
const client: AxiosInstance = Axios.create();
const client: AxiosInstance = axios.create();
const mock: MockAdapter = new MockAdapter(client);
const geocoder: Geocoder = new Geocoder(new ArcgisProvider(client));

Expand Down
4 changes: 2 additions & 2 deletions test/e2e/geocoder/provider-aggregator.spec.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import Axios from 'axios';
import axios from 'axios';
import MockAdapter from 'axios-mock-adapter';
import type { AxiosInstance } from 'axios';
import { ProviderAggregator } from '../../../src/geocoder';
Expand All @@ -18,7 +18,7 @@ import { sharedAccuracyBehaviours, sharedCommandBehaviours, sharedProvidableBeha
import type { QueryInterface } from '../../../src/interface';

describe('ProviderAggregator (2e2)', () => {
const client: AxiosInstance = Axios.create();
const client: AxiosInstance = axios.create();
const mock: MockAdapter = new MockAdapter(client);
const geocoder: ProviderAggregator = new ProviderAggregator([new ArcgisProvider(client)]);

Expand Down
4 changes: 2 additions & 2 deletions test/e2e/provider/arcgis.provider.spec.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import Axios from 'axios';
import axios from 'axios';
import MockAdapter from 'axios-mock-adapter';
import type { AxiosInstance } from 'axios';
import { InvalidArgumentException, InvalidCredentialsException, InvalidServerResponseException } from '../../../src/exception';
Expand All @@ -18,7 +18,7 @@ import { sharedAccuracyBehaviours, sharedCommandBehaviours } from '../common/sha
import type { GeocodeQueryInterface, QueryInterface, SuggestQueryInterface } from '../../../src/interface';

describe('ArcgisProvider (2e2)', () => {
const client: AxiosInstance = Axios.create();
const client: AxiosInstance = axios.create();
const mock: MockAdapter = new MockAdapter(client);
const provider: ArcgisProvider = new ArcgisProvider(client);

Expand Down
4 changes: 2 additions & 2 deletions test/e2e/provider/chain.provider.spec.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import Axios from 'axios';
import axios from 'axios';
import MockAdapter from 'axios-mock-adapter';
import type { AxiosInstance } from 'axios';
import { AccuracyEnum } from '../../../src/model';
Expand All @@ -17,7 +17,7 @@ import { sharedAccuracyBehaviours } from '../common/shared';
import type { GeocodeQueryInterface, QueryInterface, ReverseQueryInterface, SuggestQueryInterface } from '../../../src/interface';

describe('ChainProvider (2e2)', () => {
const client: AxiosInstance = Axios.create();
const client: AxiosInstance = axios.create();
const mock: MockAdapter = new MockAdapter(client);

let provider: ChainProvider = new ChainProvider([new ArcgisProvider(client), new GoogleMapsProvider(client, 'test')]);
Expand Down
4 changes: 2 additions & 2 deletions test/e2e/provider/google-maps.provider.spec.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import Axios from 'axios';
import axios from 'axios';
import MockAdapter from 'axios-mock-adapter';
import type { AxiosInstance } from 'axios';
import {
Expand Down Expand Up @@ -33,7 +33,7 @@ import type { QueryInterface } from '../../../src/interface';
import type { GeocoderException } from '../../../src/exception';

describe('GoogleMapsProvider (2e2)', () => {
const client: AxiosInstance = Axios.create();
const client: AxiosInstance = axios.create();
const mock: MockAdapter = new MockAdapter(client);
const provider: GoogleMapsProvider = new GoogleMapsProvider(client, 'test');

Expand Down
4 changes: 2 additions & 2 deletions test/e2e/provider/here.provider.spec.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import Axios from 'axios';
import axios from 'axios';
import MockAdapter from 'axios-mock-adapter';
import type { AxiosInstance } from 'axios';
import { AccuracyEnum } from '../../../src/model';
Expand All @@ -16,7 +16,7 @@ import { sharedAccuracyBehaviours, sharedCommandBehaviours } from '../common/sha
import type { QueryInterface } from '../../../src/interface';

describe('HereProvider (2e2)', () => {
const client: AxiosInstance = Axios.create();
const client: AxiosInstance = axios.create();
const mock: MockAdapter = new MockAdapter(client);
const provider: HereProvider = new HereProvider(client, 'test', 'test');

Expand Down
4 changes: 2 additions & 2 deletions test/e2e/provider/map-quest.provider.spec.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import Axios from 'axios';
import axios from 'axios';
import MockAdapter from 'axios-mock-adapter';
import type { AxiosInstance } from 'axios';
import { AccuracyEnum } from '../../../src/model';
Expand All @@ -16,7 +16,7 @@ import { sharedAccuracyBehaviours, sharedCommandBehaviours } from '../common/sha
import type { QueryInterface } from '../../../src/interface';

describe('MapQuestProvider (2e2)', () => {
const client: AxiosInstance = Axios.create();
const client: AxiosInstance = axios.create();
const mock: MockAdapter = new MockAdapter(client);
const provider: MapQuestProvider = new MapQuestProvider(client, 'test');

Expand Down
4 changes: 2 additions & 2 deletions test/e2e/provider/stateful-chain.provider.spec.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import Axios from 'axios';
import axios from 'axios';
import MockAdapter from 'axios-mock-adapter';
import type { AxiosInstance } from 'axios';
import { AccuracyEnum } from '../../../src/model';
Expand All @@ -17,7 +17,7 @@ import { sharedAccuracyBehaviours } from '../common/shared';
import type { GeocodeQueryInterface, QueryInterface, ReverseQueryInterface, SuggestQueryInterface } from '../../../src/interface';

describe('StatefulChainProvider (2e2)', () => {
const client: AxiosInstance = Axios.create();
const client: AxiosInstance = axios.create();
const mock: MockAdapter = new MockAdapter(client);

let provider: StatefulChainProvider = new StatefulChainProvider([new ArcgisProvider(client), new GoogleMapsProvider(client, 'test')]);
Expand Down
4 changes: 2 additions & 2 deletions test/fixture/provider/here.fixture.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { placeDetailsQueryFixture } from '../model/query.fixture';
import type { LocationInterface, PlaceDetailsQueryInterface, SuggestionInterface } from '../../../src/interface';
import type { LocationInterface, PlaceDetailsQueryInterface, SuggestionInterface } from '../../../src';

const providerRawLocationResponse: Readonly<any> = Object.freeze({
Response: {
Expand Down Expand Up @@ -87,7 +87,7 @@ export const providerParsedSuggestResponse: ReadonlyArray<SuggestionInterface> =
export const providerPlaceDetailsQueryFixture: Readonly<PlaceDetailsQueryInterface> = Object.freeze<PlaceDetailsQueryInterface>({
...placeDetailsQueryFixture,
...{
placeId: providerParsedLocationResponse[0].placeId!,
placeId: providerParsedLocationResponse?.[0].placeId ?? '',
},
});

Expand Down
4 changes: 2 additions & 2 deletions test/integration/geocoder/provider-aggregator.spec.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import Axios from 'axios';
import axios from 'axios';
import type { AxiosInstance } from 'axios';
import { ProviderAggregator } from '../../../src/geocoder';
import { ArcgisProvider } from '../../../src/provider';
Expand All @@ -17,7 +17,7 @@ describe('ProviderAggregator (integration)', () => {
reverseQuery = { ...reverseQueryFixture };
suggestQuery = { ...suggestQueryFixture };

const client: AxiosInstance = Axios.create();
const client: AxiosInstance = axios.create();

const provider: ArcgisProvider = new ArcgisProvider(client);

Expand Down
4 changes: 2 additions & 2 deletions test/integration/provider/arcgis.provider.spec.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import Axios from 'axios';
import axios from 'axios';
import type { AxiosInstance } from 'axios';
import { Geocoder } from '../../../src/geocoder';
import { ArcgisProvider } from '../../../src/provider';
Expand All @@ -20,7 +20,7 @@ describe('ArcgisProvider (integration)', () => {
suggestQuery = { ...suggestQueryFixture };
placeDetailsQuery = { ...providerPlaceDetailsQueryFixture };

client = Axios.create();
client = axios.create();

const provider: ArcgisProvider = new ArcgisProvider(client);

Expand Down
4 changes: 2 additions & 2 deletions test/integration/provider/chain.provider.spec.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import Axios from 'axios';
import axios from 'axios';
import type { AxiosInstance } from 'axios';
import { Geocoder } from '../../../src/geocoder';
import { AccuracyEnum } from '../../../src/model';
Expand All @@ -18,7 +18,7 @@ describe('ChainProvider (integration)', () => {
reverseQuery = { ...reverseQueryFixture };
suggestQuery = { ...suggestQueryFixture };

client = Axios.create();
client = axios.create();

const provider: ChainProvider = new ChainProvider([new ArcgisProvider(client)]);

Expand Down
4 changes: 2 additions & 2 deletions test/integration/provider/google-maps.provider.spec.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import Axios from 'axios';
import axios from 'axios';
import type { AxiosInstance } from 'axios';
import { delay } from '../../../src';
import { Geocoder } from '../../../src/geocoder';
Expand Down Expand Up @@ -38,7 +38,7 @@ describe('GoogleMapsProvider (integration)', () => {

placeDetailsQuery = { ...providerPlaceDetailsQueryFixture };

client = Axios.create();
client = axios.create();

const provider: GoogleMapsProvider = new GoogleMapsProvider(client, `${process.env.GOOGLE_MAPS_API_KEY}`);

Expand Down
Loading

0 comments on commit 3ab1f87

Please sign in to comment.