Skip to content

Commit dae16bb

Browse files
authored
Merge pull request #46 from Patternslib/upgrade-dependencies
Upgrade dependencies
2 parents 90624ac + bd08d34 commit dae16bb

File tree

13 files changed

+2465
-2311
lines changed

13 files changed

+2465
-2311
lines changed

.eslintrc.js

Lines changed: 0 additions & 1 deletion
This file was deleted.

.github/workflows/test.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ jobs:
1414
- uses: actions/checkout@v4
1515
- uses: actions/setup-node@v4
1616
with:
17-
node-version: '18'
17+
node-version: '22'
1818
cache: 'yarn'
1919
- run: |
2020
make install

.husky/.gitignore

Lines changed: 0 additions & 1 deletion
This file was deleted.

.husky/commit-msg

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

Makefile

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,13 +18,10 @@
1818
-include .env
1919
export
2020

21+
YARN ?= npx yarn
2122

22-
.PHONY: install
23-
stamp-yarn install:
24-
npx yarn install
25-
# Install pre commit hook
26-
npx yarn husky install
27-
touch stamp-yarn
23+
yarn.lock install:
24+
$(YARN) install
2825

2926

3027
# Unlink any linked dependencies before building a bundle.

eslint.config.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
module.exports = require("@patternslib/dev/eslint.config.js");

index.html

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
<!DOCTYPE HTML>
1+
<!DOCTYPE html>
22
<html>
3-
<head>
4-
<meta http-equiv="refresh" content="0; url=./src" />
5-
</head>
3+
<head>
4+
<meta http-equiv="refresh" content="0; url=./src" />
5+
</head>
66
</html>

package.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,22 +5,22 @@
55
"license": "MIT",
66
"main": "./src/leaflet.js",
77
"dependencies": {
8-
"@patternslib/patternslib": ">=9.9.16",
8+
"@patternslib/patternslib": ">=9.10.3",
99
"fontawesome-free": "^1.0.4",
1010
"jquery": "^3.7.1",
1111
"leaflet": "^1.9.4",
12-
"leaflet-geosearch": "^4.0.0",
12+
"leaflet-geosearch": "^4.2.0",
1313
"leaflet-minimap": "^3.6.1",
1414
"leaflet-providers": "^2.0.0",
1515
"leaflet-sleep": "^0.5.2",
1616
"leaflet.awesome-markers": "^2.0.5",
17-
"leaflet.fullscreen": "^3.0.2",
18-
"leaflet.locatecontrol": "^0.81.1",
17+
"leaflet.fullscreen": "^4.0.0",
18+
"leaflet.locatecontrol": "^0.84.2",
1919
"leaflet.markercluster": "^1.5.3",
2020
"leaflet.simplemarkers": "git+https://github.com/jdomingu/Leaflet.SimpleMarkers.git"
2121
},
2222
"devDependencies": {
23-
"@patternslib/dev": "^3.6.1"
23+
"@patternslib/dev": "^3.8.1"
2424
},
2525
"scripts": {
2626
"start": "NODE_ENV=development webpack serve --config webpack.config.js",

src/index.html

Lines changed: 32 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,37 @@
1-
<!DOCTYPE html>
1+
<!doctype html>
22
<html>
3-
<head>
4-
<meta charset="utf-8">
5-
<title>leaflet demo</title>
6-
<script src="https://cdn.jsdelivr.net/npm/@patternslib/[email protected]/dist/bundle.min.js"></script>
7-
<script src="/remote.min.js"></script>
8-
</head>
9-
<body>
10-
11-
<h2>pat-leaflet demo - minimal</h2>
12-
<section class="pat-clone-code">
13-
<div id="map1" style="height:400px" class="pat-leaflet" data-pat-leaflet='
3+
<head>
4+
<meta charset="utf-8" />
5+
<title>leaflet demo</title>
6+
<script src="https://cdn.jsdelivr.net/npm/@patternslib/[email protected]/dist/bundle.min.js"></script>
7+
<script src="/remote.min.js"></script>
8+
</head>
9+
<body>
10+
<h2>pat-leaflet demo - minimal</h2>
11+
<section class="pat-clone-code">
12+
<div
13+
id="map1"
14+
style="height: 400px"
15+
class="pat-leaflet"
16+
data-pat-leaflet='
1417
{
1518
"fullscreencontrol": false,
1619
"locatecontrol": false,
1720
"zoomcontrol": true,
1821
"geosearch": true,
1922
"latitude": 47.33325135,
2023
"longitude": 9.645877746692685
21-
}'></div>
22-
</section>
24+
}'
25+
></div>
26+
</section>
2327

24-
<h2>pat-leaflet demo - full</h2>
25-
<section class="pat-clone-code">
26-
<div id="map2" style="height:400px" class="pat-leaflet"
27-
data-pat-leaflet='{
28+
<h2>pat-leaflet demo - full</h2>
29+
<section class="pat-clone-code">
30+
<div
31+
id="map2"
32+
style="height: 400px"
33+
class="pat-leaflet"
34+
data-pat-leaflet='{
2835
"fullscreencontrol": true,
2936
"locatecontrol": true,
3037
"zoomcontrol": true,
@@ -35,7 +42,7 @@ <h2>pat-leaflet demo - full</h2>
3542
"maxClusterRadius": 80,
3643
"useCluster": true
3744
}'
38-
data-geojson='{
45+
data-geojson='{
3946
"type": "FeatureCollection",
4047
"features": [
4148
{
@@ -85,10 +92,10 @@ <h2>pat-leaflet demo - full</h2>
8592
]
8693
}
8794
}
88-
]}'></div>
89-
<input type="text" name="latitude" value="55.69078" id="latinput"/>
90-
<input type="text" name="longitude" value="12.55568" id="lnginput"/>
91-
</section>
92-
93-
</body>
95+
]}'
96+
></div>
97+
<input type="text" name="latitude" value="55.69078" id="latinput" />
98+
<input type="text" name="longitude" value="12.55568" id="lnginput" />
99+
</section>
100+
</body>
94101
</html>

src/leaflet.js

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ class Pattern extends BasePattern {
123123
// build layers object with tileLayer instances
124124
baseLayers[layer.title] = this.L.tileLayer.provider(
125125
layer.id,
126-
layer.options
126+
layer.options,
127127
);
128128
}
129129
if (options.map_layers.length > 1) {
@@ -150,17 +150,17 @@ class Pattern extends BasePattern {
150150
response = await fetch(options.geojson_ajaxurl);
151151
const data = await response.json();
152152
this.init_geojson(map, data);
153-
} catch (e) {
153+
} catch {
154154
log.info(
155-
`Could not load geojson data from url ${options.geojson_ajaxurl}`
155+
`Could not load geojson data from url ${options.geojson_ajaxurl}`,
156156
);
157157
return;
158158
}
159159
} else if (this.el.dataset.geojson) {
160160
try {
161161
// inject inline geoJSON data object
162162
this.init_geojson(map, JSON.parse(this.el.dataset.geojson));
163-
} catch (e) {
163+
} catch {
164164
log.info("Could not parse geojson data.");
165165
return;
166166
}
@@ -198,7 +198,7 @@ class Pattern extends BasePattern {
198198
e.marker.setIcon(this.create_marker("red"));
199199
this.bind_popup(
200200
{ properties: { editable: true, popup: e.location.label } },
201-
e.marker
201+
e.marker,
202202
);
203203
this.marker_cluster.addLayer(e.marker);
204204
}
@@ -229,9 +229,9 @@ class Pattern extends BasePattern {
229229
const minimap = new this.L.Control.MiniMap(
230230
this.L.tileLayer.provider(
231231
options.default_map_layer.id,
232-
options.default_map_layer.options
232+
options.default_map_layer.options,
233233
),
234-
{ toggleDisplay: true, mapOptions: { sleep: false } }
234+
{ toggleDisplay: true, mapOptions: { sleep: false } },
235235
);
236236
map.addControl(minimap);
237237
}
@@ -290,7 +290,7 @@ class Pattern extends BasePattern {
290290
// fit bounds
291291
bounds = this.marker_cluster.getBounds();
292292
map.fitBounds(bounds, this.fitBoundsOptions);
293-
}
293+
},
294294
);
295295
}
296296
if (input_lng) {
@@ -309,7 +309,7 @@ class Pattern extends BasePattern {
309309
// fit bounds
310310
bounds = this.marker_cluster.getBounds();
311311
map.fitBounds(bounds, this.fitBoundsOptions);
312-
}
312+
},
313313
);
314314
}
315315
return marker;

0 commit comments

Comments
 (0)