Skip to content

Commit 0a487a2

Browse files
Merge pull request #72 from geospoc/fix/update-docs
fix: update docs & minor housekeeping
2 parents 3275879 + 0c89d3d commit 0a487a2

File tree

10 files changed

+45
-141
lines changed

10 files changed

+45
-141
lines changed

.github/workflows/shipjs-manual-prepare.yml

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

.github/workflows/shipjs-trigger.yml

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2,26 +2,22 @@ name: Ship js trigger
22
on:
33
push:
44
branches:
5-
- master
5+
- main
66
jobs:
77
build:
88
name: Release
99
runs-on: ubuntu-latest
1010
steps:
1111
- uses: actions/checkout@v2
1212
with:
13-
ref: master
14-
13+
ref: main
1514
- uses: actions/setup-node@v1
1615
with:
1716
registry-url: "https://npm.pkg.github.com"
18-
- run: |
19-
if [ -f "yarn.lock" ]; then
20-
yarn install
21-
else
22-
npm install
23-
fi
24-
17+
scope: '@geospoc'
18+
- run: npm install
19+
env:
20+
NODE_AUTH_TOKEN: ${{ secrets.READ_PACKAGES_PAT }}
2521
- run: npm run release:trigger
2622
env:
2723
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.prettierrc

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

README.md

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,15 @@
22

33
[![GitHub release (latest SemVer)](https://img.shields.io/github/v/release/geospoc/v-mapbox-geocoder?sort=semver)](https://github.com/geospoc/v-mapbox-geocoder/packages) [![Ship js trigger](https://github.com/geospoc/v-mapbox-geocoder/workflows/Ship%20js%20trigger/badge.svg)](https://github.com/geospoc/v-mapbox-geocoder/actions?query=workflow%3A%22Ship+js+trigger%22) [![GitHub Release Date](https://img.shields.io/github/release-date/geospoc/v-mapbox-geocoder)](https://github.com/geospoc/v-mapbox-geocoder/releases) [![deploy](https://img.shields.io/badge/deploy-🛳%20Ship.js-blue?style=flat)](https://github.com/algolia/shipjs) [![David](https://img.shields.io/david/peer/geospoc/v-mapbox-geocoder)](https://david-dm.org/geospoc/v-mapbox-geocoder?type=peer) [![David](https://img.shields.io/david/dev/geospoc/v-mapbox-geocoder)](http://david-dm.org/geospoc/v-mapbox-geocoder?type=dev) [![GitHub issues](https://img.shields.io/github/issues/geospoc/v-mapbox-geocoder)](https://github.com/geospoc/v-mapbox-geocoder) [![GitHub last commit](https://img.shields.io/github/last-commit/geospoc/v-mapbox-geocoder)](https://github.com/geospoc/v-mapbox-geocoder/master) ![Maintenance](https://img.shields.io/maintenance/yes/2020) [![GitHub contributors](https://img.shields.io/github/contributors/geospoc/v-mapbox-geocoder)](https://github.com/geospoc/v-mapbox-geocoder/graphs/contributors) [![DeepScan grade](https://deepscan.io/api/teams/9381/projects/11871/branches/177149/badge/grade.svg)](https://deepscan.io/dashboard#view=project&tid=9381&pid=11871&bid=177149)
44

5-
[vue-mapbox](https://github.com/soal/vue-mapbox) plugin for [mapbox-gl-geocoder](https://github.com/mapbox/mapbox-gl-geocoder) support.
5+
[v-mapbox](https://github.com/vinayakkulkarni/v-mapbox) plugin for [mapbox-gl-geocoder](https://github.com/mapbox/mapbox-gl-geocoder) support.
66

77
## Usage
88

9-
First of all you need to install Mapbox GL and vue-mapbox. [See vue-mapbox doc](https://soal.github.io/vue-mapbox/#/quickstart)
10-
9+
First of all you need to install Mapbox GL and v-mapbox. [See v-mapbox doc](https://v-mapbox.netlify.app)
1110

1211
```bash
13-
# Install mabbox-gl-geocoder and vue-mapbox-geocoder:
14-
$ npm i @mapbox/mapbox-gl-geocoder vue-mapbox @geospoc/v-mapbox-geocoder
12+
# Install mapbox-gl-geocoder v-mapbox and v-mapbox-geocoder:
13+
$ npm i @mapbox/mapbox-gl-geocoder v-mapbox @geospoc/v-mapbox-geocoder
1514
```
1615

1716
Now you can add geocoder control like other controls:
@@ -33,7 +32,7 @@ Now you can add geocoder control like other controls:
3332
</template>
3433

3534
<script>
36-
import { MglMap } from 'vue-mapbox';
35+
import { MglMap } from 'v-mapbox';
3736
import MglGeocoderControl from '@geospoc/v-mapbox-geocoder';
3837
// you can also import this in your main.js or nuxt.config.js
3938
// or even main/global (s)css file

build/rollup.config.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ export default [
1919
commonjs(),
2020
vue(),
2121
],
22-
external: ['@mapbox/mapbox-gl-geocoder', 'vue-mapbox'],
22+
external: ['@mapbox/mapbox-gl-geocoder', 'v-mapbox'],
2323
},
2424
// CommonJS build
2525
{
@@ -37,7 +37,7 @@ export default [
3737
commonjs(),
3838
vue(),
3939
],
40-
external: ['@mapbox/mapbox-gl-geocoder', 'vue-mapbox'],
40+
external: ['@mapbox/mapbox-gl-geocoder', 'v-mapbox'],
4141
},
4242
// UMD build.
4343
{
@@ -48,7 +48,7 @@ export default [
4848
file: 'dist/v-mapbox-geocoder.js',
4949
globals: {
5050
'@mapbox/mapbox-gl-geocoder': 'MapboxGeocoder',
51-
'vue-mapbox': 'vueMapbox',
51+
'v-mapbox': 'vMapbox',
5252
},
5353
},
5454
plugins: [
@@ -59,6 +59,6 @@ export default [
5959
commonjs(),
6060
vue(),
6161
],
62-
external: ['@mapbox/mapbox-gl-geocoder', 'vue-mapbox'],
62+
external: ['@mapbox/mapbox-gl-geocoder', 'v-mapbox'],
6363
},
6464
];

build/rollup.min.config.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ export default {
1111
file: 'dist/v-mapbox-geocoder.min.js',
1212
globals: {
1313
'@mapbox/mapbox-gl-geocoder': 'MapboxGeocoder',
14-
'vue-mapbox': 'vueMapbox',
14+
'v-mapbox': 'vMapbox',
1515
},
1616
},
1717
plugins: [
@@ -23,5 +23,5 @@ export default {
2323
terser(),
2424
vue(),
2525
],
26-
external: ['@mapbox/mapbox-gl-geocoder', 'vue-mapbox'],
26+
external: ['@mapbox/mapbox-gl-geocoder', 'v-mapbox'],
2727
};

package-lock.json

Lines changed: 6 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "@geospoc/v-mapbox-geocoder",
33
"version": "0.2.0",
4-
"description": "Geocoder plugin for VueMapbox",
4+
"description": "Geocoder plugin for VMapbox",
55
"repository": {
66
"type": "git",
77
"url": "[email protected]:geospoc/v-mapbox-geocoder.git"
@@ -35,14 +35,18 @@
3535
"build": "npm run bundle && npm run bundle:min",
3636
"bundle": "rollup -c build/rollup.config.js",
3737
"bundle:min": "rollup -c build/rollup.min.config.js",
38-
"lint": "eslint 'src/**/*.{js,vue}'",
39-
"lintfix": "eslint --fix 'src/**/*.{js,vue}'",
38+
"lint": "npm run lint:eslint && npm run lint:prettier",
39+
"lintfix": "npm run lint:eslint:fix && npm run lint:prettier:fix",
40+
"lint:eslint": "eslint --ext .js,.vue --ignore-path .gitignore .",
41+
"lint:eslint:fix": "eslint --fix --ext .js,.vue --ignore-path .gitignore .",
42+
"lint:prettier": "prettier --check \"{,!(node_modules|dist)/**/}*.{js,vue}\" --ignore-path .gitignore",
43+
"lint:prettier:fix": "prettier --write \"{,!(node_modules|dist)/**/}*.{js,vue}\" --ignore-path .gitignore",
4044
"release:prepare": "shipjs prepare",
4145
"release:trigger": "shipjs trigger"
4246
},
4347
"peerDependencies": {
44-
"mapbox-gl": "^1.10.1",
45-
"vue-mapbox": "^0.4.1",
48+
"mapbox-gl": "^1.11.0",
49+
"v-mapbox": "^1.3.2",
4650
"@mapbox/mapbox-gl-geocoder": "^4.5.1"
4751
},
4852
"devDependencies": {
@@ -51,6 +55,7 @@
5155
"@babel/preset-env": "^7.10.4",
5256
"@commitlint/cli": "^9.0.1",
5357
"@commitlint/config-conventional": "^9.0.1",
58+
"@geospoc/prettier-config-standard": "^1.0.0",
5459
"@rollup/plugin-commonjs": "^13.0.0",
5560
"ava": "^3.10.1",
5661
"babel-eslint": "^10.1.0",

prettier.config.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
module.exports = {
2+
...require('@geospoc/prettier-config-standard'),
3+
vueIndentScriptAndStyle: true,
4+
};

src/GeocoderControl.js

Lines changed: 8 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import MapboxGeocoder from '@mapbox/mapbox-gl-geocoder';
2-
import { $helpers } from 'vue-mapbox';
2+
import { $helpers } from 'v-mapbox';
33

44
const geocoderEvents = {
55
clear: 'clear',
@@ -29,58 +29,10 @@ export default {
2929
type: String,
3030
required: true,
3131
},
32-
zoom: {
33-
type: Number,
34-
default: 16,
35-
},
36-
flyTo: {
37-
type: Boolean,
38-
default: true,
39-
},
40-
placeholder: {
41-
type: String,
42-
default: 'Search',
43-
},
4432
proximity: {
4533
type: Object,
4634
default: null,
4735
},
48-
trackProximity: {
49-
type: Boolean,
50-
default: false,
51-
},
52-
bbox: {
53-
type: Array,
54-
default: null,
55-
},
56-
types: {
57-
type: String,
58-
default: null,
59-
},
60-
country: {
61-
type: String,
62-
default: null,
63-
},
64-
minLength: {
65-
type: Number,
66-
default: 2,
67-
},
68-
limit: {
69-
type: Number,
70-
default: 5,
71-
},
72-
language: {
73-
type: String,
74-
default: null,
75-
},
76-
filter: {
77-
type: Function,
78-
default: null,
79-
},
80-
localGeocoder: {
81-
type: Function,
82-
default: null,
83-
},
8436
// Component options
8537
input: {
8638
type: String,
@@ -119,7 +71,13 @@ export default {
11971
if (this.accessToken && !this.mapbox.accessToken) {
12072
this.mapbox.accessToken = this.accessToken;
12173
}
122-
this.control = new MapboxGeocoder(this.$props);
74+
75+
this.control = new MapboxGeocoder({
76+
...this.$attrs,
77+
proximity: this.proximity,
78+
accessToken: this.accessToken,
79+
});
80+
12381
this.control.on('results', this.$_updateInput);
12482

12583
this.$_deferredMount();

0 commit comments

Comments
 (0)