Skip to content

Commit

Permalink
svelte 4.x => 5.0
Browse files Browse the repository at this point in the history
  • Loading branch information
mtmail committed Oct 20, 2024
1 parent 2ba0054 commit 200f60b
Show file tree
Hide file tree
Showing 10 changed files with 133 additions and 135 deletions.
93 changes: 48 additions & 45 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,46 +1,49 @@
{
"name": "nominatim-ui",
"description": "Debug web interface for Nominatim geocoder",
"version": "3.5.3",
"license": "GPL-2.0",
"scripts": {
"build": "rollup -c",
"dev": "rollup -c -w",
"lint": "eslint --quiet *.js src/ test/",
"lint:fix": "eslint --fix *.js src/ test/",
"test": "rollup -c && mocha --recursive test/",
"start": "static-server dist"
},
"devDependencies": {
"@eslint/eslintrc": "^3.1.0",
"@eslint/js": "^9.12.0",
"@rollup/plugin-commonjs": "^28.0",
"@rollup/plugin-node-resolve": "^15.0",
"eslint": "^9.0",
"eslint-config-airbnb-base": "^15.0",
"eslint-plugin-import": "^2.22.1",
"eslint-plugin-mocha": "^10.0",
"eslint-plugin-svelte": "^2.13",
"fs-extra": "^11.0.0",
"globals": "^15.11.0",
"http": "^0.0.1-security",
"http-proxy": "^1.18.1",
"mocha": "^10.0",
"puppeteer": "^23.0",
"rollup": "^4.22.4",
"rollup-plugin-css-only": "^4.3.0",
"rollup-plugin-livereload": "^2.0.0",
"rollup-plugin-svelte": "^7.0.0",
"rollup-plugin-terser": "^7.0.0",
"static-server": "^2.2.1",
"svelte": "^4.2"
},
"dependencies": {
"bootstrap": "^5.0.0",
"escape-html": "^1.0.3",
"leaflet": "1.9.4",
"leaflet-minimap": "^3.6.1",
"timeago.js": "^4.0.2"
},
"type": "module"
}
"name": "nominatim-ui",
"description": "Debug web interface for Nominatim geocoder",
"version": "3.5.3",
"license": "GPL-2.0",
"scripts":
{
"build": "rollup -c",
"dev": "rollup -c -w",
"lint": "eslint --quiet *.js src/ test/",
"lint:fix": "eslint --fix *.js src/ test/",
"test": "rollup -c && mocha --recursive test/",
"start": "static-server dist"
},
"devDependencies":
{
"@eslint/eslintrc": "^3.1.0",
"@eslint/js": "^9.12.0",
"@rollup/plugin-commonjs": "^28.0",
"@rollup/plugin-node-resolve": "^15.0",
"eslint": "^9.0",
"eslint-config-airbnb-base": "^15.0",
"eslint-plugin-import": "^2.22.1",
"eslint-plugin-mocha": "^10.0",
"eslint-plugin-svelte": "^2.13",
"fs-extra": "^11.0.0",
"globals": "^15.11.0",
"http": "^0.0.1-security",
"http-proxy": "^1.18.1",
"mocha": "^10.0",
"puppeteer": "^23.0",
"rollup": "^4.22.4",
"rollup-plugin-css-only": "^4.3.0",
"rollup-plugin-livereload": "^2.0.0",
"rollup-plugin-svelte": "^7.0.0",
"rollup-plugin-terser": "^7.0.0",
"static-server": "^2.2.1",
"svelte": "^5.0.0"
},
"dependencies":
{
"bootstrap": "^5.0.0",
"escape-html": "^1.0.3",
"leaflet": "1.9.4",
"leaflet-minimap": "^3.6.1",
"timeago.js": "^4.0.2"
},
"type": "module"
}
2 changes: 1 addition & 1 deletion src/components/DetailsPostcodeHint.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@
class="btn-close float-end m-1"
aria-label="Close"
on:click|stopPropagation={closeHint}
/>
></button>
<p>
Nightly calculated from nearby places having this postcode.
<a href="https://nominatim.org/release-docs/latest/admin/Maintenance/#updating-postcodes">
Expand Down
2 changes: 1 addition & 1 deletion src/components/Map.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@
</script>

<MapPosition />
<div id="map" use:mapAction />
<div id="map" use:mapAction></div>
<button id="show-map-position" class="leaflet-bar btn btn-sm btn-outline-secondary"
on:click|stopPropagation={show_map_position_click}
>show map bounds</button>
Expand Down
5 changes: 4 additions & 1 deletion src/main.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
import { mount } from 'svelte';
import App from './App.svelte';

const app = new App({ // eslint-disable-line no-unused-vars
const app = mount(App, { // eslint-disable-line no-unused-vars
target: document.body
});

export default app;
14 changes: 8 additions & 6 deletions src/pages/DeletablePage.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,14 @@

<table class="table table-striped table-hover">
<thead>
<th>Place id</th>
<th>Country Code</th>
<th>Name</th>
<th>OSM object</th>
<th>Class</th>
<th>Type</th>
<tr>
<th>Place id</th>
<th>Country Code</th>
<th>Name</th>
<th>OSM object</th>
<th>Class</th>
<th>Type</th>
</tr>
</thead>
<tbody>
{#each aPolygons as polygon}
Expand Down
2 changes: 1 addition & 1 deletion src/pages/DetailsPage.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,7 @@
{/each}

{#if Object.keys(aPlace.hierarchy) > 500}
<p>There are more child objects which are not shown.</p>
<tr><td><p>There are more child objects which are not shown.</p></td></tr>
{/if}
{:else}
<tr><td>Place is not parent of other places</td></tr>
Expand Down
18 changes: 10 additions & 8 deletions src/pages/PolygonsPage.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -28,14 +28,16 @@

<table class="table table-striped table-hover">
<thead>
<th>OSM object</th>
<th>Class</th>
<th>Type</th>
<th>Name</th>
<th>Country Code</th>
<th>Error message</th>
<th>Updated</th>
<th></th>
<tr>
<th>OSM object</th>
<th>Class</th>
<th>Type</th>
<th>Name</th>
<th>Country Code</th>
<th>Error message</th>
<th>Updated</th>
<th></th>
</tr>
</thead>
<tbody>
{#each aPolygons as polygon}
Expand Down
2 changes: 1 addition & 1 deletion test/details.js
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ describe('Details Page', function () {
it('should display No Name, no keywords, no hierarchy', async function () {
let page_content = await page.$eval('body', el => el.textContent);

assert.ok(page_content.includes('Name No Name'));
assert.ok(page_content.includes('NameNo Name'));
if (!process.env.REVERSE_ONLY) {
assert.ok(page_content.includes('Place has no keywords'));
}
Expand Down
16 changes: 11 additions & 5 deletions test/search.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,18 +41,24 @@ describe('Search Page', function () {
assert.strictEqual(await map_pos_handle.evaluate(node => node.style.display), 'block');

let map_pos_details = await page.$eval('#map-position-inner', el => el.textContent);
map_pos_details = map_pos_details.split(' \n');

let map_center_coor = map_pos_details[0]
map_pos_details = map_pos_details.split(' ');
// [
// 'map center: 20.00000,0.00000 view on osm.org',
// 'map zoom: 2',
// 'viewbox: -131.48438,69.16256,131.48438,-48.69096',
// 'last click:',
// ' mouse position: 65.69612,103.71094'
// ]
let map_center_coords = map_pos_details[0]
.split('map center: ')[1].split(' view')[0].split(',');
let map_zoom = map_pos_details[1].split('map zoom: ')[1];
let map_viewbox = map_pos_details[2].split('viewbox: ')[1].split(',');
let last_click = map_pos_details[3].split('last click: ')[1];

assert.deepStrictEqual(map_center_coor.length, 2);
assert.deepStrictEqual(map_center_coords.length, 2);
assert.ok(map_zoom);
assert.deepStrictEqual(map_viewbox.length, 4);
assert.deepStrictEqual(last_click, 'undefined');
assert.deepStrictEqual(last_click, undefined);

await page.click('#map-position-close a');
assert.strictEqual(await map_pos_handle.evaluate(node => node.style.display), 'none');
Expand Down
Loading

0 comments on commit 200f60b

Please sign in to comment.