Skip to content

Commit 3352885

Browse files
committed
Help dialog: libraries+licenses from package.json
1 parent c1cefe7 commit 3352885

File tree

3 files changed

+25
-26
lines changed

3 files changed

+25
-26
lines changed

index.html

Lines changed: 1 addition & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -360,32 +360,7 @@ <h4 class="t" data-t="help.attr.software"></h4>
360360
</li>
361361
<li>
362362
<span class="t" data-t="help.attr.other_libs"></span>
363-
<a href="https://github.com/tyrasd/osmtogeojson"
364-
>osmtogeojson</a
365-
>, <a href="https://github.com/tyrasd/togpx">togpx</a>,
366-
<a href="https://github.com/mapbox/tokml">tokml</a>,
367-
<a href="http://lodash.com">lodash</a>,
368-
<a href="http://jquery.com/">jQuery</a>,
369-
<a href="http://jqueryui.com/">jQuery UI</a>,
370-
<a href="http://html2canvas.hertzen.com/">html2canvas</a>,
371-
<a href="http://code.google.com/p/canvg/">canvg</a>,
372-
<a href="https://github.com/kajic/leaflet-locationfilter">
373-
leaflet-locationfilter
374-
</a>
375-
,
376-
<a href="https://github.com/bbecquet/Leaflet.PolylineOffset">
377-
leaflet.PolylineOffset
378-
</a>
379-
, <a href="http://mapbox.com/maki/">maki</a>,
380-
<a href="http://www.sjjb.co.uk/mapicons/">SJJB map icons</a>,
381-
<a href="https://github.com/nebulon42/osmic/">Osmic</a>,
382-
<a href="https://github.com/eligrey/FileSaver.js"
383-
>FileSaver.js</a
384-
>,
385-
<a href="https://github.com/MapBBCode/mapbbcode">MapBBCode</a
386-
>,
387-
<a href="https://github.com/mapbox/polylabel">polylabel</a>,
388-
<a href="https://github.com/osmlab/osm-auth">osm-auth</a>
363+
<span id="overpass-turbo-dependencies"></span>
389364
</li>
390365
</ul>
391366
</div>

js/ide.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -245,6 +245,9 @@ var ide = new (function () {
245245
$("#overpass-turbo-version").html(
246246
"overpass-turbo <code>" + GIT_VERSION + "</code>" // eslint-disable-line no-undef
247247
);
248+
$("#overpass-turbo-dependencies").html(
249+
APP_DEPENDENCIES // eslint-disable-line no-undef
250+
);
248251
// (very raw) compatibility check <- TODO: put this into its own function
249252
if (
250253
jQuery.support.cors != true ||

vite.config.ts

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import {defineConfig} from "vite";
33
import inject from "@rollup/plugin-inject";
44
import pegjs from "rollup-plugin-pegjs";
55

6+
import {readFileSync} from "fs";
67
import {resolve} from "path";
78
import {execSync} from "child_process";
89

@@ -12,6 +13,25 @@ const GIT_VERSION = JSON.stringify(
1213
execSync("git describe --always", {encoding: "utf-8"}).trim()
1314
);
1415

16+
const dependencies = JSON.parse(
17+
readFileSync("package.json", {encoding: "utf-8"})
18+
)["dependencies"];
19+
const APP_DEPENDENCIES = JSON.stringify(
20+
Object.keys(dependencies)
21+
.map((dependency) =>
22+
JSON.parse(
23+
readFileSync(`node_modules/${dependency}/package.json`, {
24+
encoding: "utf8"
25+
})
26+
)
27+
)
28+
.map(
29+
({name, version, license}) =>
30+
`<a href="https://www.npmjs.com/package/${name}/v/${version}">${name}</a> ${version} (${license})`
31+
)
32+
.join(", ")
33+
);
34+
1535
// https://vitejs.dev/config/
1636
export default defineConfig(() => {
1737
return {
@@ -26,6 +46,7 @@ export default defineConfig(() => {
2646
}
2747
},
2848
define: {
49+
APP_DEPENDENCIES,
2950
GIT_VERSION
3051
},
3152
plugins: [

0 commit comments

Comments
 (0)