@tileflow/dev 0.1.0-alpha.22 → 0.1.0-alpha.23
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{chunk-MIGBHCXX.js → chunk-6OJICHB3.js} +3 -1
- package/dist/{chunk-KH7CMHT3.js → chunk-G5FUSWNN.js} +1 -1
- package/dist/index.js +2 -2
- package/dist/{preview-assets-6LYL7GP7.js → preview-assets-UTUP3OML.js} +24 -15
- package/dist/preview.js +1 -1
- package/dist/server.js +1 -1
- package/package.json +3 -3
|
@@ -256,13 +256,15 @@ function renderTileflowPreviewHtml(preview, basePath, initialStatus, isSemanticP
|
|
|
256
256
|
<div class="badge" id="badge">Tileflow preview</div>
|
|
257
257
|
<div class="status" id="status" role="status"></div>
|
|
258
258
|
<div id="map"></div>
|
|
259
|
-
<script src="${basePath}/__runtime/maplibre-gl.js"></script>
|
|
260
259
|
<script type="importmap">{"imports":{"fflate":"${basePath}/__runtime/fflate.js","three":"${basePath}/__runtime/three.module.js"}}</script>
|
|
261
260
|
<script type="module">
|
|
261
|
+
import * as maplibregl from "${basePath}/__runtime/maplibre-gl.mjs";
|
|
262
262
|
import {loadTileflowStyleFonts} from "${basePath}/__runtime/tileflow-browser.js";
|
|
263
263
|
import {registerTileflowContourProtocol} from "${basePath}/__runtime/tileflow-browser.js";
|
|
264
264
|
import {registerTileflowPmtilesProtocol} from "${basePath}/__runtime/tileflow-browser.js";
|
|
265
265
|
|
|
266
|
+
maplibregl.setWorkerUrl("${basePath}/__runtime/maplibre-gl-worker.mjs");
|
|
267
|
+
|
|
266
268
|
const initialStatus = ${JSON.stringify(initialStatus)};
|
|
267
269
|
const normalizeTileflowLandmarkManifest = ${normalizeTileflowLandmarkManifest.toString()};
|
|
268
270
|
const readBoundedTileflowResponse = ${readBoundedTileflowResponse.toString()};
|
|
@@ -1742,7 +1742,7 @@ function createTileflowDevRequestHandler(options = {}) {
|
|
|
1742
1742
|
return options.session ? eventStreamResponse(options.session) : jsonResponse2({ error: "Live events require a development session." }, 404);
|
|
1743
1743
|
}
|
|
1744
1744
|
if (path.startsWith("/__runtime/")) {
|
|
1745
|
-
const runtimeResponse = (await import("./preview-assets-
|
|
1745
|
+
const runtimeResponse = (await import("./preview-assets-UTUP3OML.js")).getTileflowPreviewRuntimeResponse(path);
|
|
1746
1746
|
if (runtimeResponse) return runtimeResponse;
|
|
1747
1747
|
}
|
|
1748
1748
|
const session = options.session ?? await loadOwnedSession(url.origin);
|
package/dist/index.js
CHANGED
|
@@ -19,7 +19,7 @@ import {
|
|
|
19
19
|
readBoundedTileflowResponse,
|
|
20
20
|
renderTileflowPreviewHtml,
|
|
21
21
|
resolveTileflowPreview
|
|
22
|
-
} from "./chunk-
|
|
22
|
+
} from "./chunk-6OJICHB3.js";
|
|
23
23
|
import {
|
|
24
24
|
createTileflowArtifactStatus,
|
|
25
25
|
createTileflowComparisonRequestHandler,
|
|
@@ -31,7 +31,7 @@ import {
|
|
|
31
31
|
isTileflowRequestUrl,
|
|
32
32
|
tileflowComparisonSchemaVersion,
|
|
33
33
|
writeTileflowNodeResponse
|
|
34
|
-
} from "./chunk-
|
|
34
|
+
} from "./chunk-G5FUSWNN.js";
|
|
35
35
|
import {
|
|
36
36
|
TileflowHostedManifestOverwriteError,
|
|
37
37
|
TileflowLocalTilesetProductionError,
|
|
@@ -7,19 +7,33 @@ import { readFileSync } from "fs";
|
|
|
7
7
|
import { createRequire } from "module";
|
|
8
8
|
import { dirname, join } from "path";
|
|
9
9
|
var localRequire = createRequire(import.meta.url);
|
|
10
|
-
var
|
|
11
|
-
var localMapLibreStylesheet;
|
|
10
|
+
var localMapLibreAssets = /* @__PURE__ */ new Map();
|
|
12
11
|
var localTileflowBrowserJavaScript;
|
|
13
12
|
var localThreeCoreJavaScript;
|
|
14
13
|
var localThreeModuleJavaScript;
|
|
15
14
|
var localPmtilesJavaScript;
|
|
16
15
|
var localFflateJavaScript;
|
|
17
16
|
function getTileflowPreviewRuntimeResponse(path) {
|
|
18
|
-
if (path === "/__runtime/maplibre-gl.
|
|
19
|
-
return textAssetResponse(
|
|
17
|
+
if (path === "/__runtime/maplibre-gl.mjs") {
|
|
18
|
+
return textAssetResponse(
|
|
19
|
+
getLocalMapLibreAsset("maplibre-gl.mjs"),
|
|
20
|
+
"text/javascript; charset=utf-8"
|
|
21
|
+
);
|
|
22
|
+
}
|
|
23
|
+
if (path === "/__runtime/maplibre-gl-shared.mjs") {
|
|
24
|
+
return textAssetResponse(
|
|
25
|
+
getLocalMapLibreAsset("maplibre-gl-shared.mjs"),
|
|
26
|
+
"text/javascript; charset=utf-8"
|
|
27
|
+
);
|
|
28
|
+
}
|
|
29
|
+
if (path === "/__runtime/maplibre-gl-worker.mjs") {
|
|
30
|
+
return textAssetResponse(
|
|
31
|
+
getLocalMapLibreAsset("maplibre-gl-worker.mjs"),
|
|
32
|
+
"text/javascript; charset=utf-8"
|
|
33
|
+
);
|
|
20
34
|
}
|
|
21
35
|
if (path === "/__runtime/maplibre-gl.css") {
|
|
22
|
-
return textAssetResponse(getLocalMapLibreAsset("css"), "text/css; charset=utf-8");
|
|
36
|
+
return textAssetResponse(getLocalMapLibreAsset("maplibre-gl.css"), "text/css; charset=utf-8");
|
|
23
37
|
}
|
|
24
38
|
if (path === "/__runtime/tileflow-browser.js") {
|
|
25
39
|
return textAssetResponse(getLocalTileflowBrowserAsset(), "text/javascript; charset=utf-8");
|
|
@@ -50,16 +64,11 @@ function getTileflowPreviewRuntimeResponse(path) {
|
|
|
50
64
|
}
|
|
51
65
|
return void 0;
|
|
52
66
|
}
|
|
53
|
-
function getLocalMapLibreAsset(
|
|
54
|
-
|
|
55
|
-
if (
|
|
56
|
-
const
|
|
57
|
-
|
|
58
|
-
join(dirname(packagePath), "dist", kind === "js" ? "maplibre-gl.js" : "maplibre-gl.css"),
|
|
59
|
-
"utf8"
|
|
60
|
-
);
|
|
61
|
-
if (kind === "js") localMapLibreJavaScript = source;
|
|
62
|
-
else localMapLibreStylesheet = source;
|
|
67
|
+
function getLocalMapLibreAsset(fileName) {
|
|
68
|
+
const cached = localMapLibreAssets.get(fileName);
|
|
69
|
+
if (cached !== void 0) return cached;
|
|
70
|
+
const source = readFileSync(localRequire.resolve(`maplibre-gl/dist/${fileName}`), "utf8");
|
|
71
|
+
localMapLibreAssets.set(fileName, source);
|
|
63
72
|
return source;
|
|
64
73
|
}
|
|
65
74
|
function getLocalTileflowBrowserAsset() {
|
package/dist/preview.js
CHANGED
package/dist/server.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tileflow/dev",
|
|
3
|
-
"version": "0.1.0-alpha.
|
|
3
|
+
"version": "0.1.0-alpha.23",
|
|
4
4
|
"license": "Apache-2.0",
|
|
5
5
|
"description": "Node development utilities for Tileflow configs and builds.",
|
|
6
6
|
"type": "module",
|
|
@@ -94,14 +94,14 @@
|
|
|
94
94
|
"fflate": "0.8.3",
|
|
95
95
|
"fontkit": "2.0.4",
|
|
96
96
|
"jiti": "^2.7.0",
|
|
97
|
-
"maplibre-gl": "
|
|
97
|
+
"maplibre-gl": "6.9.0",
|
|
98
98
|
"pbf": "5.1.2",
|
|
99
99
|
"pmtiles": "4.5.0",
|
|
100
100
|
"saxes": "6.0.0",
|
|
101
101
|
"three": "0.185.1"
|
|
102
102
|
},
|
|
103
103
|
"devDependencies": {
|
|
104
|
-
"@tileflow/maps": "0.1.0-alpha.
|
|
104
|
+
"@tileflow/maps": "0.1.0-alpha.3"
|
|
105
105
|
},
|
|
106
106
|
"optionalDependencies": {
|
|
107
107
|
"sharp": "0.35.4"
|