@ideditor/location-conflation
Advanced tools
Comparing version 0.9.0 to 1.0.0
@@ -6,5 +6,5 @@ # What's New | ||
Please star our project on GitHub to show your support! :star: | ||
Please star our project on GitHub to show your support! ⭐️ | ||
_Breaking changes, which may affect downstream projects, are marked with a_ :warning: | ||
_Breaking changes, which may affect downstream projects, are marked with a_ ⚠️ | ||
@@ -20,5 +20,19 @@ | ||
# 1.0.0 | ||
##### 2021-Jun-17 | ||
* ⚠️ Initial stable release | ||
* Note: Built files will no longer be checked into GitHub | ||
* ⚠️ Replace microbundle with [esbuild](https://esbuild.github.io/) for super fast build speed. Package outputs are now: | ||
* `"module": "./index.mjs"` - ESM, modern JavaScript, works with `import` | ||
* `"main": "./dist/location-conflation.cjs"` - CJS bundle, modern JavaScript, works with `require()` | ||
* `"browser": "./dist/location-conflation.iife.js"` - IIFE bundle, modern JavaScript, works in browser `<script>` tag | ||
* No longer distributing ES5 builds | ||
* ⚠️ location-conflation is marked as `"type": "module"` now | ||
* ⚠️ Dropped support for old browsers like Internet Explorer on https://ideditor.codes | ||
* Update to country-coder v5 | ||
# 0.9.0 | ||
##### 2021-Jun-05 | ||
* Update to country-coder v4.1.0 | ||
* Update to country-coder v4.1 | ||
@@ -41,3 +55,3 @@ | ||
##### 2020-Oct-26 | ||
* Update to country-coder v4.0.0 | ||
* Update to country-coder v4 | ||
@@ -47,3 +61,3 @@ | ||
##### 2020-Aug-25 | ||
* :warning: Refactor - API now has: | ||
* ⚠️ Refactor - API now has: | ||
* `validateLocation` / `validateLocationSet` - fast, return stable ids | ||
@@ -50,0 +64,0 @@ * `resolveLocation` / `resolveLocationSet` - slower, resolve GeoJSON features |
{ | ||
"name": "@ideditor/location-conflation", | ||
"version": "0.9.0", | ||
"version": "1.0.0", | ||
"license": "ISC", | ||
@@ -18,15 +18,23 @@ "repository": "github:ideditor/location-conflation", | ||
], | ||
"main": "dist/index.js", | ||
"module": "index.mjs", | ||
"files": [ | ||
"index.mjs", | ||
"dist/" | ||
], | ||
"type": "module", | ||
"module": "./index.mjs", | ||
"main": "./dist/location-conflation.cjs", | ||
"browser": "./dist/location-conflation.iife.js", | ||
"scripts": { | ||
"all": "npm run build", | ||
"build": "npm-run-all -s dist:**", | ||
"dist:js": "rollup --config config/rollup.config.js", | ||
"dist:es5": "rollup --config config/rollup.config.es5.js", | ||
"all": "run-s clean test", | ||
"clean": "shx rm -rf dist", | ||
"build": "run-s build:**", | ||
"build:browser": "esbuild ./index.mjs --platform=browser --format=iife --main-fields=module,main --global-name=LocationConflation --bundle --sourcemap --outfile=./dist/location-conflation.iife.js", | ||
"build:cjs": "esbuild ./index.mjs --platform=node --format=cjs --bundle --sourcemap --outfile=./dist/location-conflation.cjs", | ||
"lint": "eslint index.mjs test/*.js", | ||
"test": "npm run build && npm run lint && tap --reporter terse --no-coverage test/*.js" | ||
"tap": "tap --reporter terse --no-coverage test/*.js", | ||
"test": "run-s build lint tap" | ||
}, | ||
"dependencies": { | ||
"@aitodotai/json-stringify-pretty-compact": "^1.3.0", | ||
"@ideditor/country-coder": "^4.1.0", | ||
"@ideditor/country-coder": "^5.0.1", | ||
"@mapbox/geojson-area": "^0.2.2", | ||
@@ -38,14 +46,14 @@ "circle-to-polygon": "^2.0.2", | ||
"devDependencies": { | ||
"@rollup/plugin-buble": "~0.21.3", | ||
"@rollup/plugin-commonjs": "^19.0.0", | ||
"@rollup/plugin-json": "^4.1.0", | ||
"@rollup/plugin-node-resolve": "^13.0.0", | ||
"eslint": "^7.26.0", | ||
"esbuild": "^0.12.6", | ||
"eslint": "^7.28.0", | ||
"npm-run-all": "^4.1.5", | ||
"rollup": "^2.47.0", | ||
"shx": "^0.3.3", | ||
"tap": "^15.0.9" | ||
}, | ||
"publishConfig": { | ||
"access": "public" | ||
}, | ||
"engines": { | ||
"node": ">=10" | ||
"node": "^12.20.0 || ^14.13.1 || >=16.0.0" | ||
} | ||
} |
@@ -45,39 +45,44 @@ [![build](https://github.com/ideditor/location-conflation/workflows/build/badge.svg)](https://github.com/ideditor/location-conflation/actions?query=workflow%3A%22build%22) | ||
## Usage | ||
## Installing | ||
To install **location-conflation** as a dependency in your project: | ||
```bash | ||
$ npm install --save @ideditor/location-conflation | ||
``` | ||
### Use in Node | ||
**location-conflation** is distributed in both UMD and ES6 module formats for maxmimum compatibility. ([Read more about Javascript module formats](https://dev.to/iggredible/what-the-heck-are-cjs-amd-umd-and-esm-ikm)) | ||
* `index.mjs` - ES6 module | ||
* `dist/index.js` - UMD module, ES6 syntax | ||
* `dist/index.es5.js` - UMD module, ES5 syntax | ||
`npm install @ideditor/location-conflation` | ||
Whether you require or import it, it should just work. | ||
**location-conflation** is distributed in several module formats for maxmimum compatibility. ([Read more about Javascript module formats](https://dev.to/iggredible/what-the-heck-are-cjs-amd-umd-and-esm-ikm)) | ||
```js | ||
const LocationConflation = require('@ideditor/location-conflation'); // UMD import all | ||
const LocationConflation = require('@ideditor/location-conflation').default; // require default CJS | ||
// or | ||
import * as LocationConflation from '@ideditor/location-conflation'; // ES6 import all | ||
import LocationConflation from '@ideditor/location-conflation'; // import default ESM | ||
``` | ||
You can also use **location-conflation** directly in a web browser. A good way to do this is to fetch the file from the [jsDelivr CDN](https://www.jsdelivr.com/), which can even deliver minified versions. | ||
The latest versions of many web browsers now support [ES6 modules in script tags](https://caniuse.com/#feat=es6-module) like this: | ||
```html | ||
<script type="module" src="https://cdn.jsdelivr.net/npm/@ideditor/location-conflation@0.8/index.min.mjs"></script> | ||
``` | ||
### Use in Browsers | ||
Older versions of modern ES6-capable browsers can still load the UMD build: | ||
You can also use **location-conflation** directly in a web browser. A good way to do this is to fetch the appropriate file from the [jsDelivr CDN](https://www.jsdelivr.com/), which can even deliver minified versions. | ||
The latest versions of many web browsers now support [ES modules in script tags](https://caniuse.com/#feat=es6-module) like this: | ||
```html | ||
<script src="https://cdn.jsdelivr.net/npm/@ideditor/location-conflation@0.8/dist/index.min.js"></script> | ||
<script type="module"> | ||
import LocationConflation from 'https://cdn.jsdelivr.net/npm/@ideditor/location-conflation@0.9/index.mjs'; | ||
const loco = new LocationConflation(); | ||
</script> | ||
``` | ||
Or if you need to support even older browsers like Internet Explorer, fetch the ES5 version: | ||
You can also load the IIFE build in a `<script>` tag - in this case you'll get a `LocationConflation` global to use elsewhere in your scripts: | ||
```html | ||
<script src="https://cdn.jsdelivr.net/npm/@ideditor/location-conflation@0.8/dist/index.es5.min.js"></script> | ||
<head> | ||
<script src="https://cdn.jsdelivr.net/npm/@ideditor/location-conflation@0.9/dist/location-conflation.iife.min.js"></script> | ||
</head> | ||
… | ||
<script> | ||
var loco = new LocationConflation.default(); | ||
</script> | ||
``` | ||
👉 This project uses modern JavaScript syntax for use in supported node versions and modern browsers. If you need support for legacy environments like ES5 or Internet Explorer, you'll need to build your own bundle with something like [Babel](https://babeljs.io/docs/en/index.html). | ||
| ||
@@ -87,3 +92,3 @@ | ||
```js | ||
const LocationConflation = require('@ideditor/location-conflation'); | ||
const LocationConflation = require('@ideditor/location-conflation').default; | ||
const myFeatures = require('./path/to/FeatureCollection.json'); // optional | ||
@@ -296,3 +301,3 @@ const loco = new LocationConflation(myFeatures); | ||
* [Node.js](https://nodejs.org/) version 10 or newer | ||
* [Node.js](https://nodejs.org/) version 12 or newer | ||
* [`git`](https://www.atlassian.com/git/tutorials/install-git/) for your platform | ||
@@ -299,0 +304,0 @@ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
5
1
327
Yes
2079783
9
12709
+ Added@ideditor/country-coder@5.1.0(transitive)
- Removed@ideditor/country-coder@4.1.0(transitive)