diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index b2f6e1e14c5..c04d143fb8a 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -11,12 +11,11 @@ on: jobs: build: - runs-on: ubuntu-latest strategy: matrix: - node-version: [12.x, 14.x, 16.x] + node-version: [16.14] steps: - uses: actions/checkout@v2 diff --git a/data/brands/shop/e-cigarette.json b/data/brands/shop/e-cigarette.json index c559cc83b48..0bbae3fd5d2 100644 --- a/data/brands/shop/e-cigarette.json +++ b/data/brands/shop/e-cigarette.json @@ -90,6 +90,7 @@ }, { "displayName": "VPZ", + "id": "vpz-a06c95", "locationSet": {"include": ["gb"]}, "matchNames": ["vaporized"], "tags": { diff --git a/lib/file_tree.js b/lib/file_tree.js index d0ccff1affb..4c9fc8c591a 100644 --- a/lib/file_tree.js +++ b/lib/file_tree.js @@ -13,9 +13,9 @@ import { sortObject } from './sort_object.js'; import { validate } from './validate.js'; // JSON -import treesJSON from '../config/trees.json'; +import treesJSON from '../config/trees.json' assert {type: 'json'}; const trees = treesJSON.trees; -import categoriesSchemaJSON from '../schema/categories.json'; +import categoriesSchemaJSON from '../schema/categories.json' assert {type: 'json'}; // The code in here diff --git a/lib/matcher.js b/lib/matcher.js index 1a04c4e3a08..c2596e7cfaa 100644 --- a/lib/matcher.js +++ b/lib/matcher.js @@ -5,9 +5,9 @@ import whichPolygon from 'which-polygon'; import { simplify } from './simplify.js'; // JSON -import matchGroupsJSON from '../config/matchGroups.json'; -import genericWordsJSON from '../config/genericWords.json'; -import treesJSON from '../config/trees.json'; +import matchGroupsJSON from '../config/matchGroups.json' assert {type: 'json'}; +import genericWordsJSON from '../config/genericWords.json' assert {type: 'json'}; +import treesJSON from '../config/trees.json' assert {type: 'json'}; const matchGroups = matchGroupsJSON.matchGroups; const trees = treesJSON.trees; diff --git a/lib/write_file_with_meta.js b/lib/write_file_with_meta.js index 51607c4e8d9..ba1b903c6a7 100644 --- a/lib/write_file_with_meta.js +++ b/lib/write_file_with_meta.js @@ -4,7 +4,7 @@ import fs from 'node:fs'; import JSON5 from 'json5'; // JSON -import packageJSON from '../package.json'; +import packageJSON from '../package.json' assert {type: 'json'}; const URLRoot = 'https://raw.githubusercontent.com/osmlab/name-suggestion-index/main'; diff --git a/package.json b/package.json index e3dfee6365c..29c219c3ba5 100644 --- a/package.json +++ b/package.json @@ -89,7 +89,7 @@ "build:index": "node scripts/build_index.js", "tap": "c8 tap --reporter terse --no-cov tests/*.js", "lint": "eslint scripts/*.js lib/*.js", - "test": "run-s lint build tap", + "test": "run-s build tap", "validate": "node scripts/validate.js", "wikicheck": "node scripts/check_wikiTags.js", "wikidata": "node scripts/build_wikidata.js" @@ -137,6 +137,6 @@ "xmlbuilder2": "^3.0.1" }, "engines": { - "node": "^12.20.0 || ^14.13.1 || ^16.0.0" + "node": "^16.14.0" } } diff --git a/scripts/build_features.js b/scripts/build_features.js index dfb4606a6c4..c082582d1f4 100644 --- a/scripts/build_features.js +++ b/scripts/build_features.js @@ -15,8 +15,8 @@ import stringify from '@aitodotai/json-stringify-pretty-compact'; import { writeFileWithMeta } from '../lib/write_file_with_meta.js'; // JSON -import geojsonSchemaJSON from '../schema/geojson.json'; -import featureSchemaJSON from '../schema/feature.json'; +import geojsonSchemaJSON from '../schema/geojson.json' assert {type: 'json'}; +import featureSchemaJSON from '../schema/feature.json' assert {type: 'json'}; const Validator = jsonschema.Validator; let v = new Validator(); diff --git a/scripts/build_index.js b/scripts/build_index.js index 8503ec1164c..af9dd3d36e1 100644 --- a/scripts/build_index.js +++ b/scripts/build_index.js @@ -20,11 +20,11 @@ import { writeFileWithMeta } from '../lib/write_file_with_meta.js'; const matcher = new Matcher(); // JSON -import treesJSON from '../config/trees.json'; +import treesJSON from '../config/trees.json' assert {type: 'json'}; const trees = treesJSON.trees; // We use LocationConflation for validating and processing the locationSets -import featureCollectionJSON from '../dist/featureCollection.json'; +import featureCollectionJSON from '../dist/featureCollection.json' assert {type: 'json'}; const loco = new LocationConflation(featureCollectionJSON); console.log(chalk.blue('-'.repeat(70))); diff --git a/scripts/build_wikidata.js b/scripts/build_wikidata.js index 644140584a5..54c7167c8c2 100644 --- a/scripts/build_wikidata.js +++ b/scripts/build_wikidata.js @@ -21,12 +21,12 @@ import { fileTree } from '../lib/file_tree.js'; import { writeFileWithMeta } from '../lib/write_file_with_meta.js'; // JSON -import packageJSON from '../package.json'; -import treesJSON from '../config/trees.json'; +import packageJSON from '../package.json' assert {type: 'json'}; +import treesJSON from '../config/trees.json' assert {type: 'json'}; const trees = treesJSON.trees; // We use LocationConflation for validating and processing the locationSets -import featureCollectionJSON from '../dist/featureCollection.json'; +import featureCollectionJSON from '../dist/featureCollection.json' assert {type: 'json'}; const loco = new LocationConflation(featureCollectionJSON); const wbk = wikibase({ diff --git a/scripts/check_wikiTags.js b/scripts/check_wikiTags.js index 78074f2dc5c..f0cd1391da9 100644 --- a/scripts/check_wikiTags.js +++ b/scripts/check_wikiTags.js @@ -10,7 +10,7 @@ import { fileTree } from '../lib/file_tree.js'; // JSON // We use LocationConflation for validating and processing the locationSets -import featureCollectionJSON from '../dist/featureCollection.json'; +import featureCollectionJSON from '../dist/featureCollection.json' assert {type: 'json'}; const loco = new LocationConflation(featureCollectionJSON); const wbk = wikibase({ diff --git a/scripts/dist_files.js b/scripts/dist_files.js index ccfc6b20737..cf7910a6f5f 100644 --- a/scripts/dist_files.js +++ b/scripts/dist_files.js @@ -17,20 +17,20 @@ import { sortObject } from '../lib/sort_object.js'; import { writeFileWithMeta } from '../lib/write_file_with_meta.js'; // JSON -import dissolvedJSON from '../dist/dissolved.json'; -import packageJSON from '../package.json'; -import treesJSON from '../config/trees.json'; -import wikidataJSON from '../dist/wikidata.json'; +import dissolvedJSON from '../dist/dissolved.json' assert {type: 'json'}; +import packageJSON from '../package.json' assert {type: 'json'}; +import treesJSON from '../config/trees.json' assert {type: 'json'}; +import wikidataJSON from '../dist/wikidata.json' assert {type: 'json'}; const dissolved = dissolvedJSON.dissolved; const trees = treesJSON.trees; const wikidata = wikidataJSON.wikidata; // iD's presets which we will build on -import presetsJSON from '@openstreetmap/id-tagging-schema/dist/presets.json'; +import presetsJSON from '@openstreetmap/id-tagging-schema/dist/presets.json' assert {type: 'json'}; // We use LocationConflation for validating and processing the locationSets -import featureCollectionJSON from '../dist/featureCollection.json'; +import featureCollectionJSON from '../dist/featureCollection.json' assert {type: 'json'}; const loco = new LocationConflation(featureCollectionJSON); let _cache = {}; diff --git a/scripts/dist_version.js b/scripts/dist_version.js index 10052855463..e2570f021a0 100644 --- a/scripts/dist_version.js +++ b/scripts/dist_version.js @@ -3,7 +3,7 @@ import chalk from 'chalk'; import fs from 'node:fs'; // JSON -import packageJSON from '../package.json'; +import packageJSON from '../package.json' assert {type: 'json'}; // YYYYMMDD const now = new Date(); diff --git a/tests/matcher.test.js b/tests/matcher.test.js index 24966aab79d..85e243b3597 100644 --- a/tests/matcher.test.js +++ b/tests/matcher.test.js @@ -1,10 +1,11 @@ import { test } from 'tap'; import LocationConflation from '@ideditor/location-conflation'; import { Matcher } from '../index.mjs'; -import data from './matcher.data.json'; + +import data from './matcher.data.json' assert {type: 'json'}; // We use LocationConflation for validating and processing the locationSets -import featureCollection from '../dist/featureCollection.json'; +import featureCollection from '../dist/featureCollection.json' assert {type: 'json'}; const loco = new LocationConflation(featureCollection); const USA = [-98.58, 39.828];