From 19552fc089587c3f92a316c3f760a79b1b9acd06 Mon Sep 17 00:00:00 2001 From: Bryan Housel Date: Fri, 25 Jun 2021 12:26:56 -0400 Subject: [PATCH] Upgrade several dependencies, bump minimum node version to 12 - country-coder (closes #249) - location-conflation (closes #248) - osm-community-index (closes #250) - name-suggestion-index --- .github/workflows/build.yml | 2 +- modules/core/file_fetcher.js | 6 +++--- modules/services/nsi.js | 18 +++++++++--------- package.json | 10 +++++----- 4 files changed, 18 insertions(+), 18 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 90ed9faa73..60202313dc 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -15,7 +15,7 @@ jobs: strategy: matrix: - node-version: [10.x, 12.x, 14.x, 16.x] + node-version: [12.x, 14.x, 16.x] steps: - uses: actions/checkout@v2 diff --git a/modules/core/file_fetcher.js b/modules/core/file_fetcher.js index bfd27bdbda..51c0fb1104 100644 --- a/modules/core/file_fetcher.js +++ b/modules/core/file_fetcher.js @@ -20,9 +20,9 @@ export function coreFileFetcher() { 'keepRight': 'data/keepRight.min.json', 'languages': 'data/languages.min.json', 'locales': 'locales/index.min.json', - 'oci_defaults': 'https://cdn.jsdelivr.net/npm/osm-community-index@4/dist/defaults.min.json', - 'oci_features': 'https://cdn.jsdelivr.net/npm/osm-community-index@4/dist/featureCollection.min.json', - 'oci_resources': 'https://cdn.jsdelivr.net/npm/osm-community-index@4/dist/resources.min.json', + 'oci_defaults': 'https://cdn.jsdelivr.net/npm/osm-community-index@5.0/dist/defaults.min.json', + 'oci_features': 'https://cdn.jsdelivr.net/npm/osm-community-index@5.0/dist/featureCollection.min.json', + 'oci_resources': 'https://cdn.jsdelivr.net/npm/osm-community-index@5.0/dist/resources.min.json', 'preset_categories': 'https://cdn.jsdelivr.net/npm/@openstreetmap/id-tagging-schema@3/dist/preset_categories.min.json', 'preset_defaults': 'https://cdn.jsdelivr.net/npm/@openstreetmap/id-tagging-schema@3/dist/preset_defaults.min.json', 'preset_fields': 'https://cdn.jsdelivr.net/npm/@openstreetmap/id-tagging-schema@3/dist/fields.min.json', diff --git a/modules/services/nsi.js b/modules/services/nsi.js index d2881b5a29..946a9941f1 100644 --- a/modules/services/nsi.js +++ b/modules/services/nsi.js @@ -1,4 +1,4 @@ -import { matcher as Matcher } from 'name-suggestion-index'; +import { Matcher } from 'name-suggestion-index'; import { fileFetcher, locationManager } from '../core'; import { presetManager } from '../presets'; @@ -40,13 +40,13 @@ const notBranches = /(coop|express|wireless|factory|outlet)/i; // function setNsiSources() { const sources = { - 'nsi_data': 'https://cdn.jsdelivr.net/npm/name-suggestion-index@5.0/dist/nsi.min.json', - 'nsi_dissolved': 'https://cdn.jsdelivr.net/npm/name-suggestion-index@5.0/dist/dissolved.min.json', - 'nsi_features': 'https://cdn.jsdelivr.net/npm/name-suggestion-index@5.0/dist/featureCollection.min.json', - 'nsi_generics': 'https://cdn.jsdelivr.net/npm/name-suggestion-index@5.0/dist/genericWords.min.json', - 'nsi_presets': 'https://cdn.jsdelivr.net/npm/name-suggestion-index@5.0/dist/presets/nsi-id-presets.min.json', - 'nsi_replacements': 'https://cdn.jsdelivr.net/npm/name-suggestion-index@5.0/dist/replacements.min.json', - 'nsi_trees': 'https://cdn.jsdelivr.net/npm/name-suggestion-index@5.0/dist/trees.min.json' + 'nsi_data': 'https://cdn.jsdelivr.net/npm/name-suggestion-index@6.0/dist/nsi.min.json', + 'nsi_dissolved': 'https://cdn.jsdelivr.net/npm/name-suggestion-index@6.0/dist/dissolved.min.json', + 'nsi_features': 'https://cdn.jsdelivr.net/npm/name-suggestion-index@6.0/dist/featureCollection.min.json', + 'nsi_generics': 'https://cdn.jsdelivr.net/npm/name-suggestion-index@6.0/dist/genericWords.min.json', + 'nsi_presets': 'https://cdn.jsdelivr.net/npm/name-suggestion-index@6.0/dist/presets/nsi-id-presets.min.json', + 'nsi_replacements': 'https://cdn.jsdelivr.net/npm/name-suggestion-index@6.0/dist/replacements.min.json', + 'nsi_trees': 'https://cdn.jsdelivr.net/npm/name-suggestion-index@6.0/dist/trees.min.json' }; let fileMap = fileFetcher.fileMap(); @@ -101,7 +101,7 @@ function loadNsiData() { ids: new Map() // Map (id -> NSI item) }; - _nsi.matcher = Matcher(); + _nsi.matcher = new Matcher(); _nsi.matcher.buildMatchIndex(_nsi.data); _nsi.matcher.buildLocationIndex(_nsi.data, locationManager.loco()); diff --git a/package.json b/package.json index 244f9ff126..340f156a2c 100644 --- a/package.json +++ b/package.json @@ -43,8 +43,8 @@ }, "dependencies": { "@id-sdk/math": "~3.0.0-pre.5", - "@ideditor/country-coder": "^4.1.0", - "@ideditor/location-conflation": "~0.9.0", + "@ideditor/country-coder": "~5.0.3", + "@ideditor/location-conflation": "~1.0.2", "@mapbox/geojson-area": "^0.2.2", "@mapbox/geojson-rewind": "^0.5.0", "@mapbox/sexagesimal": "1.2.0", @@ -107,11 +107,11 @@ "mapillary-js": "4.0.0", "minimist": "^1.2.3", "mocha": "^9.0.0", - "name-suggestion-index": "~5.0", + "name-suggestion-index": "~6.0", "node-fetch": "^2.6.1", "npm-run-all": "^4.0.0", "object-inspect": "1.10.3", - "osm-community-index": "~4.0.2", + "osm-community-index": "~5.0.1", "phantomjs-prebuilt": "~2.1.16", "postcss": "^8.1.1", "postcss-selector-prepend": "^0.5.0", @@ -129,7 +129,7 @@ "uglify-js": "~3.13.0" }, "engines": { - "node": ">=10" + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" }, "browserslist": [ "> 0.2%, last 6 major versions, Firefox ESR, IE 11, maintained node versions"