Skip to content

Commit 9e35aef

Browse files
committed
Fix problems on plugin build system
1 parent 20923ac commit 9e35aef

8 files changed

+116
-97
lines changed

CHANGELOG.md

+5
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,11 @@
22

33
Log of changes since the 1.1.0 version
44

5+
#### 1.9.0
6+
7+
- Add option to load selected feature on OSM website (#224)
8+
- Fix problems on plugin build system (#225)
9+
510
#### 1.8.2
611

712
- Add createBbox function to the named exports

lib/helpers.js

+3-8
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import mapboxgl from 'mapbox-gl';
22
import { featureCollection } from '@turf/helpers';
33
import bbox from '@turf/bbox';
4-
import turfBboxPolygon from '@turf/bbox-polygon';
4+
import bboxPolygon from '@turf/bbox-polygon';
55

66
export function getBounds(bbox) {
77
var left = +bbox.left,
@@ -28,14 +28,9 @@ export function getBoundingBox(bounds) {
2828
padY = Math.max((top - bottom) / 5, 0.0001);
2929
}
3030

31-
var bboxPolygon = turfBboxPolygon([
32-
left - padX,
33-
bottom - padY,
34-
right + padX,
35-
top + padY
31+
return featureCollection([
32+
bboxPolygon([left - padX, bottom - padY, right + padX, top + padY])
3633
]);
37-
38-
return featureCollection([bboxPolygon]);
3934
}
4035

4136
export function getFeatureBBOX(features) {

lib/query.js

-42
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import moment from 'moment';
22
import { config } from './config';
3-
import React from 'react';
43
export function query(changesetID) {
54
var url = config.osmBase + 'changeset/' + changesetID;
65
var options = {
@@ -43,44 +42,3 @@ export function query(changesetID) {
4342
};
4443
});
4544
}
46-
47-
var x = (
48-
<section className="cmap-filter-type-section">
49-
<h6 className="cmap-heading">Filter by type</h6>
50-
<ul className="cmap-hlist">
51-
<li>
52-
<label className="cmap-hlist-item cmap-noselect cmap-pointer">
53-
<className
54-
type="checkbox"
55-
value="nodes"
56-
checked="true"
57-
id="cmap-type-selector-nodes"
58-
/>
59-
<span className="cmap-label-text">Nodes</span>
60-
</label>
61-
</li>
62-
<li>
63-
<label className="cmap-hlist-item cmap-noselect cmap-pointer">
64-
<className
65-
type="checkbox"
66-
value="ways"
67-
checked="true"
68-
id="cmap-type-selector-ways"
69-
/>
70-
<span className="cmap-label-text">Ways</span>
71-
</label>
72-
</li>
73-
<li>
74-
<label className="cmap-hlist-item cmap-noselect cmap-pointer">
75-
<className
76-
type="checkbox"
77-
value="relations"
78-
checked="true"
79-
id="cmap-type-selector-relations"
80-
/>
81-
<span className="cmap-label-text">Relations</span>
82-
</label>
83-
</li>
84-
</ul>
85-
</section>
86-
);

lib/render.js

+5-4
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import mapboxgl from 'mapbox-gl';
22
import { EventEmitter as Events } from 'events';
3-
import { render as reactDOM } from 'react-dom';
3+
import ReactDom from 'react-dom';
44
import React from 'react';
55

66
import { getChangeset } from './getChangeset';
@@ -93,7 +93,7 @@ function renderHTML(container, changesetId, result, disableSidebar) {
9393
feature.properties.tagsCount = Object.keys(tags).length;
9494
});
9595

96-
reactDOM(
96+
ReactDom.render(
9797
<div>
9898
<div className="cmap-map" />
9999

@@ -102,7 +102,7 @@ function renderHTML(container, changesetId, result, disableSidebar) {
102102
<div className="cmap-diff-tags cmap-scroll-styled" />
103103
<div className="cmap-diff-members cmap-scroll-styled" />
104104
</div>
105-
{!disableSidebar &&
105+
{!disableSidebar && (
106106
<Sidebar
107107
result={result}
108108
changesetId={changesetId}
@@ -124,7 +124,8 @@ function renderHTML(container, changesetId, result, disableSidebar) {
124124
map.renderMap('mapbox://styles/mapbox/streets-v9', result);
125125
}
126126
}}
127-
/>}
127+
/>
128+
)}
128129
</div>,
129130
info
130131
);

package.json

+3-4
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "changeset-map",
3-
"version": "1.8.2",
3+
"version": "1.9.0",
44
"description": "Provide visualization of changesets to OSMCha & to the OSM community",
55
"main": "dist/bundle.js",
66
"scripts": {
@@ -46,7 +46,7 @@
4646
"@rollup/plugin-node-resolve": "^9.0.0",
4747
"@rollup/plugin-replace": "^2.3.3",
4848
"eslint-config-mourner": "^2.0.1",
49-
"eslint-plugin-react": "^7.0.0",
49+
"eslint-plugin-react": "^7.22.0",
5050
"gh-pages": "^1.0.0",
5151
"http-server": "^0.12.3",
5252
"husky": "^0.13.3",
@@ -58,8 +58,7 @@
5858
"rollup": "^2.26.9",
5959
"rollup-plugin-eslint": "^3.0.0",
6060
"rollup-plugin-node-builtins": "^2.1.2",
61-
"rollup-plugin-node-globals": "^1.4.0",
62-
"rollup-plugin-node-polyfills": "^0.2.1"
61+
"rollup-plugin-node-globals": "^1.4.0"
6362
},
6463
"lint-staged": {
6564
"*.js": [

rollup.plugin.config.js

+9-7
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import { nodeResolve } from '@rollup/plugin-node-resolve';
55
import globals from 'rollup-plugin-node-globals';
66
import eslint from 'rollup-plugin-eslint';
77
import json from '@rollup/plugin-json';
8-
import nodePolyfills from 'rollup-plugin-node-polyfills';
8+
import builtins from 'rollup-plugin-node-builtins';
99

1010
export default {
1111
input: 'lib/index.js',
@@ -21,10 +21,11 @@ export default {
2121
replace({
2222
'process.env.NODE_ENV': JSON.stringify('production')
2323
}),
24-
nodePolyfills(),
24+
builtins(),
2525
nodeResolve({
26-
mainFields: ['browser', 'main'],
27-
modulesOnly: true
26+
jsnext: true,
27+
main: true,
28+
browser: true
2829
}),
2930
commonjs({
3031
include: ['node_modules/**'],
@@ -34,14 +35,15 @@ export default {
3435
'Children',
3536
'Component',
3637
'PropTypes',
37-
'createElement',
38-
'createBbox'
38+
'createElement'
3939
],
4040
'node_modules/react-dom/index.js': ['render']
4141
}
4242
}),
4343
json({ indent: '' }),
44-
babel(),
44+
babel({
45+
exclude: 'node_modules/**'
46+
}),
4547
globals()
4648
]
4749
};

rollup.website.config.js

+1-2
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,7 @@ export default {
3535
'Children',
3636
'Component',
3737
'PropTypes',
38-
'createElement',
39-
'createBbox'
38+
'createElement'
4039
],
4140
'node_modules/react-dom/index.js': ['render']
4241
}

0 commit comments

Comments
 (0)