@tileflow/dev 0.1.0-alpha.27 → 0.1.0-alpha.29
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/README.md +11 -4
- package/dist/artifacts.d.ts +42 -2
- package/dist/artifacts.js +9 -1
- package/dist/{chunk-6OJICHB3.js → chunk-CJGM6HTT.js} +70 -8
- package/dist/{chunk-QAMFAM3S.js → chunk-LXSFLPIU.js} +465 -255
- package/dist/{chunk-UCBGTEQV.js → chunk-QYM2CUZB.js} +13 -3
- package/dist/index.d.ts +1 -1
- package/dist/index.js +11 -3
- package/dist/preview.d.ts +2 -0
- package/dist/preview.js +1 -1
- package/dist/server.js +2 -2
- package/docs/native-artifacts.md +18 -1
- package/package.json +3 -3
|
@@ -1,7 +1,10 @@
|
|
|
1
1
|
import {
|
|
2
2
|
createTileflowArtifactSession,
|
|
3
|
-
|
|
4
|
-
|
|
3
|
+
createTileflowLineBackgroundGlyphResponder,
|
|
4
|
+
parseTileflowLineBackgroundGlyphPath,
|
|
5
|
+
tileflowArtifactSessionSchemaVersion,
|
|
6
|
+
tileflowLineBackgroundGlyphRoute
|
|
7
|
+
} from "./chunk-LXSFLPIU.js";
|
|
5
8
|
import {
|
|
6
9
|
normalizeTileflowBasePath
|
|
7
10
|
} from "./chunk-UTRO4IBQ.js";
|
|
@@ -1709,6 +1712,7 @@ function createTileflowDevRequestHandler(options = {}) {
|
|
|
1709
1712
|
const cwd = options.cwd ?? process.cwd();
|
|
1710
1713
|
const apiBaseUrl = options.apiBaseUrl ?? defaultTileflowApiUrl;
|
|
1711
1714
|
let ownedSessionPromise;
|
|
1715
|
+
const lineBackgroundGlyphs = createTileflowLineBackgroundGlyphResponder({ cwd });
|
|
1712
1716
|
let closed = false;
|
|
1713
1717
|
let lastOrigin;
|
|
1714
1718
|
const loadOwnedSession = (origin) => {
|
|
@@ -1783,6 +1787,12 @@ function createTileflowDevRequestHandler(options = {}) {
|
|
|
1783
1787
|
);
|
|
1784
1788
|
}
|
|
1785
1789
|
if (!artifacts) return unavailableArtifactsResponse(state);
|
|
1790
|
+
if (path.startsWith(`/${tileflowLineBackgroundGlyphRoute}/`)) {
|
|
1791
|
+
const glyphRequest = parseTileflowLineBackgroundGlyphPath(path);
|
|
1792
|
+
const upstream = glyphRequest ? artifacts.lineBackgroundGlyphs?.[glyphRequest.mapName] : void 0;
|
|
1793
|
+
if (!glyphRequest || !upstream) return jsonResponse2({ error: "Unknown glyph range." }, 404);
|
|
1794
|
+
return await lineBackgroundGlyphs(upstream, glyphRequest.fontStack, glyphRequest.range);
|
|
1795
|
+
}
|
|
1786
1796
|
if (path.startsWith("/tilesets/")) {
|
|
1787
1797
|
const fileName = path.replace(/^\/+/, "");
|
|
1788
1798
|
const localTileset = artifacts.localTilesets?.find(
|
|
@@ -1985,7 +1995,7 @@ function getRequestPathname(url) {
|
|
|
1985
1995
|
}
|
|
1986
1996
|
}
|
|
1987
1997
|
function isOwnedTileflowRequestPath(path) {
|
|
1988
|
-
return path === "/" || path === "/build-manifest.json" || path === "/manifest.json" || path === "/__events" || path === "/__status" || getTileflowStyleInspectionSelection(path) !== void 0 || path.startsWith("/generations/") || path.startsWith("/icons/") || path.startsWith("/tilesets/") || getTileflowStyleSelection(path) !== void 0 || path.startsWith("/fonts/") || path.startsWith("/__runtime/");
|
|
1998
|
+
return path === "/" || path === "/build-manifest.json" || path === "/manifest.json" || path === "/__events" || path === "/__status" || getTileflowStyleInspectionSelection(path) !== void 0 || path.startsWith("/generations/") || path.startsWith("/icons/") || path.startsWith("/tilesets/") || getTileflowStyleSelection(path) !== void 0 || path.startsWith("/fonts/") || path.startsWith(`/${tileflowLineBackgroundGlyphRoute}/`) || path.startsWith("/__runtime/");
|
|
1989
1999
|
}
|
|
1990
2000
|
function tileflowErrorResponse(error) {
|
|
1991
2001
|
if (error instanceof Error && "code" in error && error.code === "PREVIEW_SELECTION_INVALID") {
|
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { CreateTileflowArtifactPlanOptions, TileflowArtifactAcquisition, TileflowArtifactDiagnostic, TileflowArtifactFile, TileflowArtifactInputGraph, TileflowArtifactPlan, TileflowArtifactSession, TileflowArtifactSessionOptions, TileflowArtifactSessionState, TileflowBuildArtifacts, TileflowBuildArtifactsOptions, TileflowBuildStyleInspections, TileflowHostedManifestOverwriteError, TileflowLocalTilesetFile, TileflowLocalTilesetProductionError, TileflowManifestOptions, WriteTileflowArtifactPlanOptions, WriteTileflowBuildArtifactsOptions, assertNoLocalTilesetsForProduction, assertTileflowSelfHostedManifestTarget, createTileflowArtifactDiagnostics, createTileflowArtifactPlan, createTileflowArtifactSession, createTileflowBuildArtifacts, createTileflowBuildProvenance, createTileflowManifest, createTileflowStyle, createTileflowStyles, disposeTileflowBuildArtifacts, getTileflowArtifactFiles, getTileflowAssetBasePath, getTileflowAssetFileName, getTileflowWatchPaths, isTileflowArtifactInputPath, joinTileflowPublicUrl, normalizeTileflowBasePath, prepareTileflowHostedNativeDeployment, prepareTileflowLocalTilesets, refreshTileflowArtifactSession, resolveTileflowArtifactPublicUrls, tileflowArtifactInventoryFileName, tileflowArtifactPlanSchemaVersion, tileflowArtifactSessionSchemaVersion, writeTileflowArtifactPlan, writeTileflowBuildArtifacts } from './artifacts.js';
|
|
1
|
+
export { CreateTileflowArtifactPlanOptions, TileflowArtifactAcquisition, TileflowArtifactDiagnostic, TileflowArtifactFile, TileflowArtifactInputGraph, TileflowArtifactPlan, TileflowArtifactSession, TileflowArtifactSessionOptions, TileflowArtifactSessionState, TileflowBuildArtifacts, TileflowBuildArtifactsOptions, TileflowBuildStyleInspections, TileflowHostedManifestOverwriteError, TileflowLineBackgroundGlyphProviders, TileflowLineBackgroundGlyphResponder, TileflowLocalTilesetFile, TileflowLocalTilesetProductionError, TileflowManifestOptions, WriteTileflowArtifactPlanOptions, WriteTileflowBuildArtifactsOptions, assertNoLocalTilesetsForProduction, assertTileflowSelfHostedManifestTarget, createTileflowArtifactDiagnostics, createTileflowArtifactPlan, createTileflowArtifactSession, createTileflowBuildArtifacts, createTileflowBuildProvenance, createTileflowLineBackgroundGlyphResponder, createTileflowManifest, createTileflowStyle, createTileflowStyles, disposeTileflowBuildArtifacts, getTileflowArtifactFiles, getTileflowAssetBasePath, getTileflowAssetFileName, getTileflowWatchPaths, isTileflowArtifactInputPath, joinTileflowPublicUrl, normalizeTileflowBasePath, parseTileflowLineBackgroundGlyphPath, prepareTileflowHostedNativeDeployment, prepareTileflowLocalTilesets, refreshTileflowArtifactSession, resolveTileflowArtifactPublicUrls, tileflowArtifactInventoryFileName, tileflowArtifactPlanSchemaVersion, tileflowArtifactSessionSchemaVersion, tileflowLineBackgroundGlyphRoute, usesTileflowLineBackgroundGlyphs, writeTileflowArtifactPlan, writeTileflowBuildArtifacts } from './artifacts.js';
|
|
2
2
|
export { LoadTileflowConfigOptions, LoadedTileflowConfig, TileflowValidationError, assertValidTileflowConfig, defaultTileflowApiUrl, defaultTileflowConfigPath, defaultTileflowManifestPath, getFirstTileflowMapName, getTileflowMapNames, loadTileflowConfig, loadTileflowConfigWithInputs, loadValidTileflowConfig, loadValidTileflowConfigWithInputs } from './config.js';
|
|
3
3
|
export { CompiledTileflowFontBundle, PrepareTileflowStyleFontsOptions, PreparedTileflowStyleFonts, TileflowFontCompilationError, TileflowFontCompilationIssue, TileflowFontCompilationTarget, bindTileflowStyleFontBundle, getTileflowFontWatchPaths, prepareTileflowStyleFonts, replaceTileflowStyleFontSources } from './fonts.js';
|
|
4
4
|
export { CompileTileflowIconPackagesOptions, CompileTileflowIconPackagesResult, CompiledTileflowIconPackage, CompiledTileflowIconPackageFile, ComposeTileflowIconSourcesOptions, InspectTileflowIconCatalogsOptions, PreparedTileflowBuildCatalog, PreparedTileflowCatalog, ReadTileflowIconDirectoryResult, TileflowBuildAsset, TileflowComposedIconContributor, TileflowComposedIconSources, TileflowComposedIconWinner, TileflowIconCacheOptions, TileflowIconCatalog, TileflowIconCatalogAtlasRectangle, TileflowIconCatalogContributor, TileflowIconCatalogIcon, TileflowIconCatalogIconSource, TileflowIconCatalogInspection, TileflowIconCatalogMap, TileflowIconCatalogRenderedDensity, TileflowIconCatalogSourceFormat, TileflowIconCompilationError, TileflowIconCompilationIssue, TileflowIconCompilationTarget, TileflowIconDirectoryEntry, TileflowIconDirectorySourceFile, TileflowIconReplacement, TileflowIconResolutionOptions, TileflowMapIconPackageBinding, TileflowRenderedIcon, TileflowRenderedIconCell, TileflowSourceCatalog, VerifiedTileflowIconArtifact, compileTileflowIconPackages, composeTileflowIconSources, getTileflowIconCacheDirectory, getTileflowIconWatchPaths, iconFileExtensions, inspectTileflowIconCatalogs, loadTileflowIconSetArtifact, packTileflowRenderedIcons, prepareTileflowCatalogIcons, readTileflowIconDirectory, readTileflowIconsLockfile, readTileflowIconsLockfileText, renderTileflowIconAtlasPreview, storeTileflowIconSetArtifact, verifyTileflowIconArtifact, writeTileflowIconsLockfile } from './icons.js';
|
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-CJGM6HTT.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-QYM2CUZB.js";
|
|
35
35
|
import {
|
|
36
36
|
TileflowHostedManifestOverwriteError,
|
|
37
37
|
TileflowLocalTilesetProductionError,
|
|
@@ -42,6 +42,7 @@ import {
|
|
|
42
42
|
createTileflowArtifactSession,
|
|
43
43
|
createTileflowBuildArtifacts,
|
|
44
44
|
createTileflowBuildProvenance,
|
|
45
|
+
createTileflowLineBackgroundGlyphResponder,
|
|
45
46
|
createTileflowManifest,
|
|
46
47
|
createTileflowStyle,
|
|
47
48
|
createTileflowStyles,
|
|
@@ -49,15 +50,18 @@ import {
|
|
|
49
50
|
getTileflowArtifactFiles,
|
|
50
51
|
getTileflowWatchPaths,
|
|
51
52
|
isTileflowArtifactInputPath,
|
|
53
|
+
parseTileflowLineBackgroundGlyphPath,
|
|
52
54
|
prepareTileflowHostedNativeDeployment,
|
|
53
55
|
prepareTileflowLocalTilesets,
|
|
54
56
|
refreshTileflowArtifactSession,
|
|
55
57
|
tileflowArtifactInventoryFileName,
|
|
56
58
|
tileflowArtifactPlanSchemaVersion,
|
|
57
59
|
tileflowArtifactSessionSchemaVersion,
|
|
60
|
+
tileflowLineBackgroundGlyphRoute,
|
|
61
|
+
usesTileflowLineBackgroundGlyphs,
|
|
58
62
|
writeTileflowArtifactPlan,
|
|
59
63
|
writeTileflowBuildArtifacts
|
|
60
|
-
} from "./chunk-
|
|
64
|
+
} from "./chunk-LXSFLPIU.js";
|
|
61
65
|
import {
|
|
62
66
|
inspectTileflowPmtiles,
|
|
63
67
|
inspectTileflowPmtilesForLocalUse
|
|
@@ -140,6 +144,7 @@ export {
|
|
|
140
144
|
createTileflowCommandSummary,
|
|
141
145
|
createTileflowComparisonRequestHandler,
|
|
142
146
|
createTileflowDevRequestHandler,
|
|
147
|
+
createTileflowLineBackgroundGlyphResponder,
|
|
143
148
|
createTileflowManifest,
|
|
144
149
|
createTileflowNodeRequest,
|
|
145
150
|
createTileflowStructuredDiagnostics,
|
|
@@ -179,6 +184,7 @@ export {
|
|
|
179
184
|
normalizeTileflowBasePath,
|
|
180
185
|
normalizeTileflowLandmarkManifest,
|
|
181
186
|
packTileflowRenderedIcons,
|
|
187
|
+
parseTileflowLineBackgroundGlyphPath,
|
|
182
188
|
prepareTileflowCatalogIcons,
|
|
183
189
|
prepareTileflowHostedNativeDeployment,
|
|
184
190
|
prepareTileflowLocalTilesets,
|
|
@@ -203,6 +209,8 @@ export {
|
|
|
203
209
|
tileflowArtifactSessionSchemaVersion,
|
|
204
210
|
tileflowCommandDocumentSchemaVersion,
|
|
205
211
|
tileflowComparisonSchemaVersion,
|
|
212
|
+
tileflowLineBackgroundGlyphRoute,
|
|
213
|
+
usesTileflowLineBackgroundGlyphs,
|
|
206
214
|
validateTileflowStyle,
|
|
207
215
|
verifyTileflowIconArtifact,
|
|
208
216
|
writeTileflowArtifactPlan,
|
package/dist/preview.d.ts
CHANGED
|
@@ -58,6 +58,8 @@ type ResolvedTileflowPreview = {
|
|
|
58
58
|
label: string;
|
|
59
59
|
mapName: string;
|
|
60
60
|
themeName: string;
|
|
61
|
+
/** Every theme of a map preview, in declaration order. A scene owns its theme and omits this. */
|
|
62
|
+
themeNames?: readonly string[];
|
|
61
63
|
viewport?: NormalizedTileflowCaptureScene['viewport'];
|
|
62
64
|
};
|
|
63
65
|
declare class TileflowPreviewSelectionError extends Error {
|
package/dist/preview.js
CHANGED
package/dist/server.js
CHANGED
|
@@ -9,11 +9,11 @@ import {
|
|
|
9
9
|
isTileflowRequestUrl,
|
|
10
10
|
tileflowComparisonSchemaVersion,
|
|
11
11
|
writeTileflowNodeResponse
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-QYM2CUZB.js";
|
|
13
13
|
import {
|
|
14
14
|
createTileflowArtifactDiagnostics,
|
|
15
15
|
tileflowArtifactSessionSchemaVersion
|
|
16
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-LXSFLPIU.js";
|
|
17
17
|
import "./chunk-ONYQNLNA.js";
|
|
18
18
|
import {
|
|
19
19
|
getTileflowAssetBasePath,
|
package/docs/native-artifacts.md
CHANGED
|
@@ -73,6 +73,15 @@ layer ID, the lowering version and deterministic branch order, with collision ch
|
|
|
73
73
|
whole input style. The original layer's replacements stay together; surrounding layers are not
|
|
74
74
|
reordered. Existing sort-key expressions are retained, not simplified or replaced.
|
|
75
75
|
|
|
76
|
+
Replacements shift the physical index of every later layer, so lowering rebinds the style's layer
|
|
77
|
+
references from the recorded spans. Each `tileflow:interaction-manifest` POI `priority` becomes its
|
|
78
|
+
layer's final index. An overlay placement anchor naming an expanded layer moves to that layer's first
|
|
79
|
+
replacement, because anchors mark insertion-before boundaries. Metadata that the spans cannot prove,
|
|
80
|
+
such as a POI priority that differs from its compiled layer index, a POI entry whose source does not
|
|
81
|
+
match its layer or an anchor naming a missing layer, fails with `NATIVE_UNSUPPORTED_STYLE` at the
|
|
82
|
+
style's `/metadata` pointer rather than being guessed. Local builds, watched sessions and native
|
|
83
|
+
preview share this step with Hosted publication.
|
|
84
|
+
|
|
76
85
|
Work is bounded per property by depth 16, 512 decision visits, 64 decision paths, 16 distinct
|
|
77
86
|
outcomes and 64 dash elements; the product is limited to 32 physical layers and 32 zoom intervals
|
|
78
87
|
per logical layer. Raw compiler input must fit 160,000 JSON nodes before any lowering. Its expanded
|
|
@@ -137,7 +146,8 @@ style SHA-256 values, input/output layer counts, projection normalization, and t
|
|
|
137
146
|
output start/count and affected properties of each changed layer. Ordinals refer to the complete
|
|
138
147
|
style layer arrays, including unchanged layers. These spans make the deterministic physical IDs
|
|
139
148
|
traceable without duplicating layer definitions in the receipt. The input hash binds shared
|
|
140
|
-
compiler output; the lowered hash
|
|
149
|
+
compiler output; the lowered hash includes the rebound layer references and precedes native font
|
|
150
|
+
preparation and generation URL retargeting.
|
|
141
151
|
The build-manifest hash separately binds the final prepared styles and assets. All styles receive
|
|
142
152
|
an entry, including styles for which no lowering was needed. Schema v1 build records do not imply
|
|
143
153
|
this preparation policy and are not parsed as v2.
|
|
@@ -152,6 +162,13 @@ URLs remain relative to their owning documents. An explicit absolute or host-rel
|
|
|
152
162
|
an inert `.invalid` document base only to check relative URL syntax; it does not publish that base
|
|
153
163
|
or infer the application's real delivery origin.
|
|
154
164
|
|
|
165
|
+
A served local preview can use an absolute HTTP base, such as `http://127.0.0.1:3333`, only when it
|
|
166
|
+
also passes that exact origin as `developmentOrigin`. Native checks then accept HTTP resource URLs,
|
|
167
|
+
such as the sprite and fonts, with that scheme, host and port. Every other origin still requires
|
|
168
|
+
HTTPS, and browser protocols remain rejected. The option is never inferred from a base URL.
|
|
169
|
+
Web preparation, `target: 'production'` and `writeTileflowBuildArtifacts()` reject it with
|
|
170
|
+
`NATIVE_RENDERER_UNSUPPORTED` at `/developmentOrigin`, so written artifacts never depend on it.
|
|
171
|
+
|
|
155
172
|
Omitting `renderer`, or specifying `renderer: 'web'`, preserves the existing web artifact bytes and
|
|
156
173
|
output layout. The native record is absent from web plans.
|
|
157
174
|
|
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.29",
|
|
4
4
|
"license": "Apache-2.0",
|
|
5
5
|
"description": "Node development utilities for Tileflow configs and builds.",
|
|
6
6
|
"type": "module",
|
|
@@ -90,7 +90,7 @@
|
|
|
90
90
|
"dependencies": {
|
|
91
91
|
"@mapbox/vector-tile": "3.0.0",
|
|
92
92
|
"@maplibre/maplibre-gl-style-spec": "24.8.5",
|
|
93
|
-
"@tileflow/core": ">=0.1.0-alpha.
|
|
93
|
+
"@tileflow/core": ">=0.1.0-alpha.31 <0.1.0-beta.0",
|
|
94
94
|
"chokidar": "4.0.3",
|
|
95
95
|
"fflate": "0.8.3",
|
|
96
96
|
"fontkit": "2.0.4",
|
|
@@ -102,7 +102,7 @@
|
|
|
102
102
|
"three": "0.185.1"
|
|
103
103
|
},
|
|
104
104
|
"devDependencies": {
|
|
105
|
-
"@tileflow/maps": "0.1.0-alpha.
|
|
105
|
+
"@tileflow/maps": "0.1.0-alpha.7"
|
|
106
106
|
},
|
|
107
107
|
"optionalDependencies": {
|
|
108
108
|
"sharp": "0.35.4"
|