Skip to content

Commit

Permalink
Merge pull request #20 from astridx/maplibre-gl-inspect
Browse files Browse the repository at this point in the history
  • Loading branch information
MichaelKreil committed Apr 5, 2024
2 parents 9e9543c + f914f0d commit 99ef28c
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 11 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,6 @@ VersaTiles Frontend utilizes several external resources and libraries, including
- Fonts from [VersaTiles Fonts](https://github.com/versatiles-org/versatiles-fonts)
- Styles and sprites from [VersaTiles Style](https://github.com/versatiles-org/versatiles-style)
- MapLibre GL JS from [MapLibre GL JS GitHub](https://github.com/maplibre/maplibre-gl-js)
- MapLibre GL Inspect from [MapLibre GL Inspect GitHub](https://github.com/acalcutt/maplibre-gl-inspect)
- MapLibre GL Inspect from [MapLibre GL Inspect GitHub](https://github.com/maplibre/maplibre-gl-inspect)

Note: Some external dependencies may require separate installations or configurations.
2 changes: 1 addition & 1 deletion frontends/frontend-minimal/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
<script src="assets/mapdesigner/mapdesigner-control.js"></script>
<link href="assets/mapdesigner/mapdesigner-control.css" rel="stylesheet">

<script src="assets/maplibre-gl-inspect/maplibre-gl-inspect.min.js"></script>
<script src="assets/maplibre-gl-inspect/maplibre-gl-inspect.js"></script>
<link href="assets/maplibre-gl-inspect/maplibre-gl-inspect.css" rel="stylesheet">

<script src="assets/styles/versatiles-style.js"></script>
Expand Down
2 changes: 1 addition & 1 deletion frontends/frontend/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
<script src="assets/mapdesigner/mapdesigner-control.js"></script>
<link href="assets/mapdesigner/mapdesigner-control.css" rel="stylesheet">

<script src="assets/maplibre-gl-inspect/maplibre-gl-inspect.min.js"></script>
<script src="assets/maplibre-gl-inspect/maplibre-gl-inspect.js"></script>
<link href="assets/maplibre-gl-inspect/maplibre-gl-inspect.css" rel="stylesheet">

<script src="assets/styles/versatiles-style.js"></script>
Expand Down
6 changes: 3 additions & 3 deletions src/lib/assets.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ describe('getAssets', () => {
const glrvCalls = jest.mocked(getLatestReleaseVersion).mock.calls;
glrvCalls.sort((a, b) => a[0].localeCompare(b[0]) || a[1].localeCompare(b[1]));
expect(glrvCalls).toStrictEqual([
['acalcutt', 'maplibre-gl-inspect'],
['maplibre', 'maplibre-gl-inspect'],
['maplibre', 'maplibre-gl-js'],
['versatiles-org', 'versatiles-fonts'],
['versatiles-org', 'versatiles-style'],
Expand All @@ -47,8 +47,8 @@ describe('getAssets', () => {
const curlResults = jest.mocked(Curl).mock.results.map(e => (e.value as { url: string }).url);
curlResults.sort();
expect(curlResults).toStrictEqual([
'https://github.com/acalcutt/maplibre-gl-inspect/releases/download/v1.2.3/maplibre-gl-inspect.css',
'https://github.com/acalcutt/maplibre-gl-inspect/releases/download/v1.2.3/maplibre-gl-inspect.min.js',
'https://github.com/maplibre/maplibre-gl-inspect/releases/download/v1.2.3/maplibre-gl-inspect.css',
'https://github.com/maplibre/maplibre-gl-inspect/releases/download/v1.2.3/maplibre-gl-inspect.js',
'https://github.com/maplibre/maplibre-gl-js/releases/download/v1.2.3/dist.zip',
'https://github.com/versatiles-org/versatiles-fonts/releases/download/v1.2.3/fonts.tar.gz',
'https://github.com/versatiles-org/versatiles-style/releases/download/v1.2.3/sprites.tar.gz',
Expand Down
7 changes: 2 additions & 5 deletions src/lib/assets.ts
Original file line number Diff line number Diff line change
Expand Up @@ -85,13 +85,10 @@ export function getAssets(fileSystem: FileSystem): PromiseFunction {
*/
function addMaplibreInspect(): PromiseFunction {
const folder = 'assets/maplibre-gl-inspect';
const label = notes.add('[MapLibre GL Inspect](https://github.com/acalcutt/maplibre-gl-inspect)');
return PromiseFunction.wrapAsync('add maplibre-gl-inspect', 1, async () => {
const version = await getLatestReleaseVersion('acalcutt', 'maplibre-gl-inspect');
label.setVersion(version);
const baseUrl = `https://github.com/acalcutt/maplibre-gl-inspect/releases/download/v${version}/`;
const baseUrl = `https://unpkg.com/@maplibre/maplibre-gl-inspect@latest/dist/`;
await Promise.all([
new Curl(fileSystem, baseUrl + 'maplibre-gl-inspect.min.js').save(join(folder, 'maplibre-gl-inspect.min.js')),
new Curl(fileSystem, baseUrl + 'maplibre-gl-inspect.js').save(join(folder, 'maplibre-gl-inspect.js')),
new Curl(fileSystem, baseUrl + 'maplibre-gl-inspect.css').save(join(folder, 'maplibre-gl-inspect.css')),
]);
});
Expand Down

0 comments on commit 99ef28c

Please sign in to comment.