Skip to content

Commit 00276a0

Browse files
authored
Merge pull request #4 from miles-grant-ibigroup/dev
Migrate to Typescript
2 parents e6ce728 + 503172a commit 00276a0

File tree

13 files changed

+8696
-6915
lines changed

13 files changed

+8696
-6915
lines changed

.flowconfig

Lines changed: 0 additions & 11 deletions
This file was deleted.

.github/workflows/node-ci.yml

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
name: Node.js CI
2+
3+
on: [push, pull_request]
4+
5+
jobs:
6+
build:
7+
runs-on: ubuntu-latest
8+
9+
steps:
10+
- uses: actions/checkout@v2
11+
- name: Use Node.js 14
12+
uses: actions/setup-node@v2
13+
with:
14+
node-version: 14.x
15+
- name: Install npm packages using cache
16+
uses: bahmutov/npm-install@v1
17+
with:
18+
# the IBI Group TSDX fork has some dependency issues
19+
# that cause yarn install to fail on a ci runner. Disabling
20+
# concurrency allows installation to complete successfully
21+
install-command: yarn --frozen-lockfile --network-concurrency 1
22+
- name: Lint Code
23+
run: yarn lint
24+
- name: Lint Docs
25+
run: yarn lint-docs
26+
- name: Test Code
27+
run: yarn test-node
28+
- name: Build Package
29+
run: yarn build
30+
31+
# at this point, the build is successful
32+
- name: Semantic Release
33+
if: github.event_name == 'push' && github.ref == 'refs/heads/master'
34+
env:
35+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
36+
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
37+
run: yarn semantic-release

.gitignore

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,4 +34,11 @@ jspm_packages/
3434
.yarn-integrity
3535

3636
# built files
37-
build
37+
build/*
38+
dist/*
39+
40+
# OS X
41+
.DS_Store
42+
43+
# Handled by TSDX
44+
.eslintrc.js

.npmignore

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,5 @@
22
tmp
33
__tests__
44
coverage
5-
flow-typed
6-
.flowconfig
7-
.travis.yml
85
yarn.lock
6+
.github

.travis.yml

Lines changed: 0 additions & 21 deletions
This file was deleted.

__tests__/__snapshots__/index.js.snap renamed to __tests__/__snapshots__/index.test.ts.snap

Lines changed: 57 additions & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// Jest Snapshot v1, https://goo.gl/fbAQLP
22

3-
exports[`basic autocomplete g-a-g response 1`] = `
3+
exports[`geocoder-arcgis-geojson autocomplete should make basic autocomplete query: basic autocomplete g-a-g response 1`] = `
44
Object {
55
"features": Array [
66
Object {
@@ -60,9 +60,43 @@ Object {
6060
}
6161
`;
6262

63-
exports[`basic autocomplete request uri 1`] = `"/arcgis/rest/services/World/GeocodeServer/suggest?text=123%20main%20st&outFields=*&maxSuggestions=10&f=json"`;
63+
exports[`geocoder-arcgis-geojson autocomplete should make basic autocomplete query: basic autocomplete request uri 1`] = `"/arcgis/rest/services/World/GeocodeServer/suggest?text=123%20main%20st&outFields=*&maxSuggestions=10&f=json"`;
6464

65-
exports[`basic bulk g-a-g response 1`] = `
65+
exports[`geocoder-arcgis-geojson bulk should handle bulk query resulting in no address found: bulk g-a-g response with no address found 1`] = `
66+
Object {
67+
"features": Array [
68+
Object {
69+
"geometry": Object {
70+
"coordinates": Array [
71+
0,
72+
0,
73+
],
74+
"type": "Point",
75+
},
76+
"properties": Object {
77+
"confidence": 0,
78+
"country": "",
79+
"country_a": "",
80+
"county": "",
81+
"label": "Address not found",
82+
"locality": "",
83+
"name": "",
84+
"neighbourhood": "",
85+
"region": "",
86+
"resultId": 0,
87+
},
88+
"type": "Feature",
89+
},
90+
],
91+
"query": Object {
92+
"addresses": Array [
93+
"aefgjil",
94+
],
95+
},
96+
}
97+
`;
98+
99+
exports[`geocoder-arcgis-geojson bulk should make basic bulk query: basic bulk g-a-g response 1`] = `
66100
Object {
67101
"features": Array [
68102
Object {
@@ -71,7 +105,7 @@ Object {
71105
-68.28902999999997,
72106
44.29358000000008,
73107
],
74-
"type": "point",
108+
"type": "Point",
75109
},
76110
"properties": Object {
77111
"confidence": 1,
@@ -85,7 +119,7 @@ Object {
85119
"region": "Maine",
86120
"resultId": 0,
87121
},
88-
"type": "feature",
122+
"type": "Feature",
89123
},
90124
],
91125
"query": Object {
@@ -96,7 +130,7 @@ Object {
96130
}
97131
`;
98132

99-
exports[`basic reverse g-a-g response 1`] = `
133+
exports[`geocoder-arcgis-geojson reverse should make basic reverse query: basic reverse g-a-g response 1`] = `
100134
Object {
101135
"features": Array [
102136
Object {
@@ -105,7 +139,7 @@ Object {
105139
-122.00718855545652,
106140
37.060855792976916,
107141
],
108-
"type": "point",
142+
"type": "Point",
109143
},
110144
"properties": Object {
111145
"country_a": "USA",
@@ -116,19 +150,19 @@ Object {
116150
"neighbourhood": "",
117151
"region": "California",
118152
},
119-
"type": "feature",
153+
"type": "Feature",
120154
},
121155
],
122156
"query": Object {
123-
"lat": 37.06146,
124-
"lon": -122.006443,
157+
"x": -122.006443,
158+
"y": 37.06146,
125159
},
126160
}
127161
`;
128162

129-
exports[`basic reverse request uri 1`] = `"/arcgis/rest/services/World/GeocodeServer/reverseGeocode?location=-122.006443%2C37.06146&maxLocations=10&f=json"`;
163+
exports[`geocoder-arcgis-geojson reverse should make basic reverse query: basic reverse request uri 1`] = `"/arcgis/rest/services/World/GeocodeServer/reverseGeocode?location=-122.006443%2C37.06146&maxLocations=10&f=json"`;
130164

131-
exports[`basic search g-a-g response 1`] = `
165+
exports[`geocoder-arcgis-geojson search should make basic search query: basic search g-a-g response 1`] = `
132166
Object {
133167
"features": Array [
134168
Object {
@@ -137,7 +171,7 @@ Object {
137171
-68.28902999999997,
138172
44.29358000000008,
139173
],
140-
"type": "point",
174+
"type": "Point",
141175
},
142176
"properties": Object {
143177
"confidence": 1,
@@ -151,15 +185,15 @@ Object {
151185
"region": "Maine",
152186
"resultId": undefined,
153187
},
154-
"type": "feature",
188+
"type": "Feature",
155189
},
156190
Object {
157191
"geometry": Object {
158192
"coordinates": Array [
159193
175.91785000000004,
160194
-37.552359999999965,
161195
],
162-
"type": "point",
196+
"type": "Point",
163197
},
164198
"properties": Object {
165199
"confidence": 0.7440000000000001,
@@ -173,15 +207,15 @@ Object {
173207
"region": "",
174208
"resultId": undefined,
175209
},
176-
"type": "feature",
210+
"type": "Feature",
177211
},
178212
Object {
179213
"geometry": Object {
180214
"coordinates": Array [
181215
-93.16481632584107,
182216
42.01650127782905,
183217
],
184-
"type": "point",
218+
"type": "Point",
185219
},
186220
"properties": Object {
187221
"confidence": 0.6713,
@@ -195,15 +229,15 @@ Object {
195229
"region": "Iowa",
196230
"resultId": undefined,
197231
},
198-
"type": "feature",
232+
"type": "Feature",
199233
},
200234
Object {
201235
"geometry": Object {
202236
"coordinates": Array [
203237
-93.16319981148884,
204238
42.016789740145164,
205239
],
206-
"type": "point",
240+
"type": "Point",
207241
},
208242
"properties": Object {
209243
"confidence": 0.6713,
@@ -217,15 +251,15 @@ Object {
217251
"region": "Iowa",
218252
"resultId": undefined,
219253
},
220-
"type": "feature",
254+
"type": "Feature",
221255
},
222256
Object {
223257
"geometry": Object {
224258
"coordinates": Array [
225259
7.554969892325715,
226260
52.121028096728054,
227261
],
228-
"type": "point",
262+
"type": "Point",
229263
},
230264
"properties": Object {
231265
"confidence": 0.604,
@@ -239,7 +273,7 @@ Object {
239273
"region": "Nordrhein-Westfalen",
240274
"resultId": undefined,
241275
},
242-
"type": "feature",
276+
"type": "Feature",
243277
},
244278
],
245279
"query": Object {
@@ -248,38 +282,4 @@ Object {
248282
}
249283
`;
250284

251-
exports[`basic search request uri 1`] = `"/arcgis/rest/services/World/GeocodeServer/findAddressCandidates?outFields=*&maxLocations=10&SingleLine=123%20main%20st&f=json"`;
252-
253-
exports[`bulk g-a-g response with no address found 1`] = `
254-
Object {
255-
"features": Array [
256-
Object {
257-
"geometry": Object {
258-
"coordinates": Array [
259-
0,
260-
0,
261-
],
262-
"type": "point",
263-
},
264-
"properties": Object {
265-
"confidence": 0,
266-
"country": "",
267-
"country_a": "",
268-
"county": "",
269-
"label": "Address not found",
270-
"locality": "",
271-
"name": "",
272-
"neighbourhood": "",
273-
"region": "",
274-
"resultId": 0,
275-
},
276-
"type": "feature",
277-
},
278-
],
279-
"query": Object {
280-
"addresses": Array [
281-
"aefgjil",
282-
],
283-
},
284-
}
285-
`;
285+
exports[`geocoder-arcgis-geojson search should make basic search query: basic search request uri 1`] = `"/arcgis/rest/services/World/GeocodeServer/findAddressCandidates?outFields=*&maxLocations=10&SingleLine=123%20main%20st&f=json"`;

0 commit comments

Comments
 (0)