@tileflow/dev 0.1.0-alpha.42 → 0.1.0-alpha.43

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/artifacts.js CHANGED
@@ -32,7 +32,7 @@ import {
32
32
  usesTileflowLineBackgroundGlyphs,
33
33
  writeTileflowArtifactPlan,
34
34
  writeTileflowBuildArtifacts
35
- } from "./chunk-OQCK4AXD.js";
35
+ } from "./chunk-3IHCBD7R.js";
36
36
  import {
37
37
  getTileflowAssetBasePath,
38
38
  getTileflowAssetFileName,
@@ -51,7 +51,7 @@ import {
51
51
  defaultTileflowConfigPath
52
52
  } from "./chunk-AQUGMUZW.js";
53
53
  import "./chunk-D4OE4ITL.js";
54
- import "./chunk-ONYQNLNA.js";
54
+ import "./chunk-6SLT6ONM.js";
55
55
  export {
56
56
  TileflowHostedManifestOverwriteError,
57
57
  TileflowLocalTilesetProductionError,
@@ -25,7 +25,7 @@ import {
25
25
  } from "./chunk-D4OE4ITL.js";
26
26
  import {
27
27
  inspectTileflowPmtilesForLocalUse
28
- } from "./chunk-ONYQNLNA.js";
28
+ } from "./chunk-6SLT6ONM.js";
29
29
 
30
30
  // src/artifacts.ts
31
31
  import { createHash as createHash5 } from "crypto";
@@ -378,6 +378,7 @@ async function prepareTileflowLocalTilesets(project, styles, options) {
378
378
  for (const [sourceId, source] of Object.entries(map.sources ?? {}).sort(
379
379
  ([left], [right]) => compareCodeUnits(left, right)
380
380
  )) {
381
+ if (source.kind !== "hosted-tileset") continue;
381
382
  const requestedPath = resolve2(options.baseDirectory, source.local);
382
383
  const sourcePath = await realpath(requestedPath).catch(() => requestedPath);
383
384
  if (!isPathWithin(projectRoot, sourcePath)) {
@@ -2851,7 +2852,9 @@ function assertNoLocalTilesetsForProduction(artifacts) {
2851
2852
  if (artifacts.localTilesets?.length) throw new TileflowLocalTilesetProductionError();
2852
2853
  }
2853
2854
  function hasLocalTilesetSources(project) {
2854
- return Object.values(project.maps).some((map) => Object.keys(map.sources ?? {}).length > 0);
2855
+ return Object.values(project.maps).some(
2856
+ (map) => Object.values(map.sources ?? {}).some((source) => source.kind === "hosted-tileset")
2857
+ );
2855
2858
  }
2856
2859
  async function assertTileflowSelfHostedManifestTarget(manifestPath, options = {}) {
2857
2860
  if (options.overwriteHostedManifest) return;
@@ -24,7 +24,7 @@ var inspectionLimits = Object.freeze({
24
24
  maxValuesPerField: 16
25
25
  });
26
26
  var maxArchiveBytes = 8e9;
27
- var maximumDecodedBytes = 4 * 1024 * 1024 * 1024;
27
+ var maximumDecodedBytes = 8 * 1024 * 1024 * 1024;
28
28
  var minimumDecodedBytes = 64 * 1024 * 1024;
29
29
  var maxDecompressedSectionBytes = 16 * 1024 * 1024;
30
30
  var defaultMaximumDirectoryDepth = 32;
@@ -420,9 +420,20 @@ async function validatePmtilesDirectoryTree(source, header, budget, maximumDirec
420
420
  ];
421
421
  const countedDirectories = /* @__PURE__ */ new Set();
422
422
  const processedContexts = /* @__PURE__ */ new Set();
423
- const clusteredContents = /* @__PURE__ */ new Set();
424
423
  const decompressDirectory = createSectionDecompressor(budget);
425
- let clusteredEnd = null;
424
+ let clusteredEnd = 0;
425
+ const advanceClusteredFrontier = (offset, length) => {
426
+ const end = offset + length;
427
+ if (offset === clusteredEnd) {
428
+ clusteredEnd = end;
429
+ } else if (offset > clusteredEnd || end > clusteredEnd) {
430
+ throw inspectionError(
431
+ "TF_TILESET_ARCHIVE_INVALID",
432
+ "archive",
433
+ "PMTiles clustered contents are not contiguous in TileID order."
434
+ );
435
+ }
436
+ };
426
437
  let addressedTiles = 0;
427
438
  let totalEntries = 0;
428
439
  let tileEntries = 0;
@@ -430,20 +441,7 @@ async function validatePmtilesDirectoryTree(source, header, budget, maximumDirec
430
441
  signal?.throwIfAborted();
431
442
  const item = pending.pop();
432
443
  if (item.kind === "clustered-content") {
433
- const key = `${item.offset}:${item.length}`;
434
- if (clusteredContents.has(key)) continue;
435
- if (clusteredEnd === null ? item.offset !== 0 : item.offset !== clusteredEnd) {
436
- throw inspectionError(
437
- "TF_TILESET_ARCHIVE_INVALID",
438
- "archive",
439
- "PMTiles clustered contents are not contiguous in TileID order."
440
- );
441
- }
442
- clusteredContents.add(key);
443
- clusteredEnd = item.offset + item.length;
444
- assertParserMemory(
445
- processedContexts.size + countedDirectories.size + clusteredContents.size + pending.length
446
- );
444
+ advanceClusteredFrontier(item.offset, item.length);
447
445
  continue;
448
446
  }
449
447
  const current = item;
@@ -459,9 +457,7 @@ async function validatePmtilesDirectoryTree(source, header, budget, maximumDirec
459
457
  processedContexts.add(contextKey);
460
458
  const firstPhysicalVisit = !countedDirectories.has(current.key);
461
459
  countedDirectories.add(current.key);
462
- assertParserMemory(
463
- processedContexts.size + countedDirectories.size + clusteredContents.size + pending.length
464
- );
460
+ assertParserMemory(processedContexts.size + countedDirectories.size + pending.length);
465
461
  const response = await source.getBytes(current.offset, current.length, signal);
466
462
  if (response.data.byteLength !== current.length) {
467
463
  throw inspectionError("TF_TILESET_ARCHIVE_INVALID", "archive", "Short PMTiles directory.");
@@ -537,11 +533,15 @@ async function validatePmtilesDirectoryTree(source, header, budget, maximumDirec
537
533
  addressedTiles += entry.runLength;
538
534
  tileEntries += 1;
539
535
  if (header.clustered) {
540
- nextItems.push({
541
- kind: "clustered-content",
542
- length: entry.length,
543
- offset: entry.offset
544
- });
536
+ if (nextItems.length === 0) {
537
+ advanceClusteredFrontier(entry.offset, entry.length);
538
+ } else {
539
+ nextItems.push({
540
+ kind: "clustered-content",
541
+ length: entry.length,
542
+ offset: entry.offset
543
+ });
544
+ }
545
545
  }
546
546
  }
547
547
  if (!Number.isSafeInteger(addressedTiles) || !Number.isSafeInteger(tileEntries)) {
@@ -551,9 +551,7 @@ async function validatePmtilesDirectoryTree(source, header, budget, maximumDirec
551
551
  for (let index = nextItems.length - 1; index >= 0; index -= 1) {
552
552
  pending.push(nextItems[index]);
553
553
  }
554
- assertParserMemory(
555
- processedContexts.size + countedDirectories.size + clusteredContents.size + pending.length
556
- );
554
+ assertParserMemory(processedContexts.size + countedDirectories.size + pending.length);
557
555
  }
558
556
  if (header.numAddressedTiles !== 0 && addressedTiles !== header.numAddressedTiles || header.numTileEntries !== 0 && tileEntries !== header.numTileEntries) {
559
557
  throw inspectionError(
package/dist/server.js CHANGED
@@ -5,7 +5,7 @@ import {
5
5
  parseTileflowLineBackgroundGlyphPath,
6
6
  tileflowArtifactSessionSchemaVersion,
7
7
  tileflowLineBackgroundGlyphRoute
8
- } from "./chunk-OQCK4AXD.js";
8
+ } from "./chunk-3IHCBD7R.js";
9
9
  import {
10
10
  getTileflowAssetBasePath,
11
11
  getTileflowAssetFileName,
@@ -24,7 +24,7 @@ import {
24
24
  defaultTileflowConfigPath
25
25
  } from "./chunk-AQUGMUZW.js";
26
26
  import "./chunk-D4OE4ITL.js";
27
- import "./chunk-ONYQNLNA.js";
27
+ import "./chunk-6SLT6ONM.js";
28
28
 
29
29
  // src/server.ts
30
30
  import { open } from "fs/promises";
package/dist/tilesets.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  inspectTileflowPmtiles
3
- } from "./chunk-ONYQNLNA.js";
3
+ } from "./chunk-6SLT6ONM.js";
4
4
  export {
5
5
  inspectTileflowPmtiles
6
6
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tileflow/dev",
3
- "version": "0.1.0-alpha.42",
3
+ "version": "0.1.0-alpha.43",
4
4
  "license": "Apache-2.0",
5
5
  "description": "Node development utilities for Tileflow configs and builds.",
6
6
  "type": "module",
@@ -83,7 +83,7 @@
83
83
  "dependencies": {
84
84
  "@mapbox/vector-tile": "3.0.0",
85
85
  "@maplibre/maplibre-gl-style-spec": "26.4.4",
86
- "@tileflow/core": ">=0.1.0-alpha.46 <0.1.0-beta.0",
86
+ "@tileflow/core": ">=0.1.0-alpha.48 <0.1.0-beta.0",
87
87
  "chokidar": "6.0.0",
88
88
  "fontkit": "2.0.4",
89
89
  "jiti": "^2.7.0",
@@ -95,7 +95,7 @@
95
95
  "three": "0.185.1"
96
96
  },
97
97
  "devDependencies": {
98
- "@tileflow/maps": "0.1.0-alpha.18"
98
+ "@tileflow/maps": "0.1.0-alpha.20"
99
99
  },
100
100
  "optionalDependencies": {
101
101
  "sharp": "0.35.5"