-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: upgrade to react-leaflet@3.0.0 (#101)
* feat: upgrade to react-leaflet@3.0.0-beta * chore: release version 2.0.0-alpha.0 * style: prettier config * build: use @babel/runtime * chore: release 2.0.0-alpha.1 * chore: configure eslint with jest * feat: drop support for IE11 * chore: release v2.0.0-beta.0 * fix: fix commonjs build * chore: release v2.0.0-beta.1 * chore: release v2.0.0-beta.2 * chore: make @babel/runtime dependency instead of peerdependency * chore: drop support for edge 18 * build: typescript tooling * chore: upgrade dependencies * chore: use @typescript-eslint/parser * chore: upgrade to react@^17.0.0-rc * chore: upgrade dependencies * chore: upgrade dependencies * refactor: switch to named export * build: add react-leaflet-v3 tag to npm keywords * chore: upgrade dependencies * chore: release v2.0.0-beta.4 * docs: update readme * chore: upgrade dependencies * chore: upgrade dependencies
- Loading branch information
Showing
15 changed files
with
781 additions
and
511 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
const ENV = process.env.BABEL_ENV || process.env.NODE_ENV || 'development'; | ||
|
||
const config = { | ||
presets: [ | ||
[ | ||
'@babel/env', | ||
{ | ||
targets: { | ||
browsers: [ | ||
'chrome > 74', | ||
'edge >= 81', | ||
'firefox >= 68', | ||
'ios >= 12', | ||
'opera >= 58', | ||
'safari >= 12', | ||
'samsung >= 10' | ||
] | ||
}, | ||
modules: false, | ||
loose: true, | ||
bugfixes: true, | ||
debug: false | ||
} | ||
], | ||
'@babel/react', | ||
'@babel/typescript' | ||
], | ||
env: { | ||
cjs: { | ||
plugins: ['@babel/transform-modules-commonjs'] | ||
}, | ||
test: { | ||
plugins: ['@babel/transform-modules-commonjs'] | ||
} | ||
} | ||
}; | ||
|
||
module.exports = config; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
{ | ||
"singleQuote": true | ||
"singleQuote": true, | ||
"arrowParens": "always", | ||
"trailingComma": "none" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
{ | ||
"env": { | ||
"jest": true | ||
} | ||
} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
import * as React from 'react'; | ||
import { renderIntoDocument } from 'react-dom/test-utils'; | ||
|
||
import { MapContainer, TileLayer } from 'react-leaflet'; | ||
|
||
import { NmScale } from '../src/nmscale'; | ||
import LeafletNmScale from '../src/leafletnmscale'; | ||
|
||
describe('NmScale', () => { | ||
it('adds the scale to the map', (done) => { | ||
const spy_updateNautical = jest.spyOn( | ||
LeafletNmScale.prototype, | ||
'_updateNautical' | ||
); | ||
|
||
renderIntoDocument( | ||
<MapContainer | ||
center={[0, 0]} | ||
zoom={10} | ||
whenCreated={() => { | ||
expect(spy_updateNautical).toHaveBeenCalledTimes(1); | ||
done(); | ||
}} | ||
> | ||
<TileLayer url="https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png" /> | ||
<NmScale /> | ||
</MapContainer> | ||
); | ||
}); | ||
}); |
Oops, something went wrong.