@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.
@@ -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-6LYL7GP7.js")).getTileflowPreviewRuntimeResponse(path);
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-MIGBHCXX.js";
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-KH7CMHT3.js";
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 localMapLibreJavaScript;
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.js") {
19
- return textAssetResponse(getLocalMapLibreAsset("js"), "text/javascript; charset=utf-8");
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(kind) {
54
- if (kind === "js" && localMapLibreJavaScript !== void 0) return localMapLibreJavaScript;
55
- if (kind === "css" && localMapLibreStylesheet !== void 0) return localMapLibreStylesheet;
56
- const packagePath = localRequire.resolve("maplibre-gl/package.json");
57
- const source = readFileSync(
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
@@ -5,7 +5,7 @@ import {
5
5
  readBoundedTileflowResponse,
6
6
  renderTileflowPreviewHtml,
7
7
  resolveTileflowPreview
8
- } from "./chunk-MIGBHCXX.js";
8
+ } from "./chunk-6OJICHB3.js";
9
9
  import "./chunk-6MGFMKG3.js";
10
10
  import "./chunk-D4OE4ITL.js";
11
11
  export {
package/dist/server.js CHANGED
@@ -9,7 +9,7 @@ import {
9
9
  isTileflowRequestUrl,
10
10
  tileflowComparisonSchemaVersion,
11
11
  writeTileflowNodeResponse
12
- } from "./chunk-KH7CMHT3.js";
12
+ } from "./chunk-G5FUSWNN.js";
13
13
  import {
14
14
  createTileflowArtifactDiagnostics,
15
15
  tileflowArtifactSessionSchemaVersion
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tileflow/dev",
3
- "version": "0.1.0-alpha.22",
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": "5.24.0",
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.2"
104
+ "@tileflow/maps": "0.1.0-alpha.3"
105
105
  },
106
106
  "optionalDependencies": {
107
107
  "sharp": "0.35.4"