@tileflow/dev 0.1.0-alpha.19 → 0.1.0-alpha.20

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 CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  Node utilities used by the Tileflow CLI and build integrations.
4
4
 
5
- Most apps should use `@tileflow/cli`, `@tileflow/vite`, or `@tileflow/next` directly. Use this
5
+ Most apps should use `tileflow`, `@tileflow/vite`, or `@tileflow/next` directly. Use this
6
6
  package when you are building a custom dev server, bundler plugin, or deployment adapter that needs
7
7
  to load and compile the single map exported by `tileflow.config.ts`.
8
8
 
@@ -12,6 +12,12 @@ import {createTileflowBuildArtifacts} from '@tileflow/dev/artifacts';
12
12
  const artifacts = await createTileflowBuildArtifacts({
13
13
  config: 'tileflow.config.ts',
14
14
  });
15
+
16
+ try {
17
+ // Serve, capture, or write this exact generation.
18
+ } finally {
19
+ await artifacts.dispose?.();
20
+ }
15
21
  ```
16
22
 
17
23
  The integration surfaces are deliberately split: use `@tileflow/dev/artifacts` for source
@@ -31,14 +37,25 @@ point to content-addressed `generations/<sha256>/...` theme styles and sprites;
31
37
  installed before the manifest pointer changes. Stable style paths are
32
38
  `styles/<map>/<theme>.json`; every manifest lookup resolves a concrete theme. The disk writer also stages the complete plan,
33
39
  records a managed-file inventory, rolls back caught filesystem failures, and removes only stale
34
- files named by its previous valid inventory. It retains the immediately preceding immutable
35
- generation during each replacement, so a client that already read the old manifest can finish its
36
- style and sprite requests; the next replacement retires that older generation. Stable `styles/`
37
- and `icons/` paths remain available, but generation-consistent consumers
38
- resolve maps through `manifest.json`.
40
+ files named by its previous valid inventory. Stable `styles/` and `icons/` paths remain available,
41
+ but generation-consistent consumers resolve maps through `manifest.json`.
42
+
43
+ A local `hostedTileset()` path remains user-owned input. Dev performs bounded header, root-directory,
44
+ and metadata checks, then creates an opaque immutable snapshot under
45
+ `.tileflow/cache/pmtiles-snapshots/v1/`, using copy-on-write cloning when available and a safe copy
46
+ otherwise. It does not hash the complete archive or traverse every leaf directory. Dev and Capture
47
+ read only that snapshot. The current generation and already-started operations retain references;
48
+ a replaced generation accepts no new acquisitions and is collected after its last operation.
49
+ The Style-facing path remains `tilesets/<logical-id>.pmtiles` across generations; physical snapshot
50
+ identity stays out of Style JSON. Generation ETags make cached PMTiles reads restart instead of
51
+ mixing ranges when current changes. Invalid edits keep the prior valid generation. Production
52
+ writers reject unresolved local PMTiles instead of copying, content-addressing, deduplicating, or
53
+ retaining them. Explicit `tileset publish` owns managed publication and exhaustive validation.
54
+ Startup removes snapshot generations owned by dead processes, and symlinked snapshot-store
55
+ boundaries are rejected.
39
56
 
40
57
  Every plan also emits canonical `build-manifest.json` (schema version 1). For each map it records
41
- the leaf `mapVersion`, resolved lineage, effective icon/font source identities, Recipe ABI, and
58
+ the leaf `mapVersion`, resolved lineage, effective icon/font source identities, semantic compiler ABI, and
42
59
  one entry per concrete theme with `colorScheme`, identity, inferred legacy `dataRequirements`,
43
60
  multi-source `sourceRequirements`, and `styleSha256`. The multi-source contract records each
44
61
  referenced vector source independently and records raster DEM source ID, encoding, and tile size;
@@ -46,17 +63,17 @@ it therefore distinguishes Bathymetry vector bands from optional relief without
46
63
  fields. `mapRevisionSha256` identifies the effective cartographic definition after `extends`;
47
64
  `assetSetSha256` for that map's generated runtime resources. Data requirements are derived from the
48
65
  final Style layers and fields rather than copied from a manually maintained allowlist, so disabled
49
- or overridden modules do not claim data they no longer use. The Recipe ABI remains a separate
50
- `recipe: {compiler, compilerVersion}` compatibility axis.
66
+ or overridden modules do not claim data they no longer use. Maps use the single implicit semantic
67
+ compiler; its ABI remains a separate `semanticCompiler: {name, version}` build-manifest axis.
51
68
 
52
69
  The map revision is versioned and domain-separated. It contains the resolved cartographic design,
53
- the compiler family, private effective module contributions, and effective icon/font source
54
- identities. Map `id`, `name`, editorial `mapVersion`, default `view`, capture `scenes`, delivery
55
- policy, package SemVer, compiler ABI, local paths, timestamps, generated sprite/font output, and a
70
+ semantic language version, effective public module/render-stack design, and effective icon/font
71
+ identities. Map `id`, `name`, editorial `mapVersion`, default `view`, capture `scenes`, package
72
+ SemVer, compiler ABI, local paths, timestamps, generated sprite/font output, and a
56
73
  concrete resolution of a floating World selector are deliberately outside it. Changing a shadowed
57
74
  ancestor does not change the revision; changing an effective cartographic override or source asset
58
- does. Lineage and the leaf `mapVersion` remain beside the hash for traceability, Style JSON owns its
59
- compiled-output identity, and Hosted delivery policy belongs to the deployment fingerprint. The
75
+ does. Lineage and the leaf `mapVersion` remain beside the hash for traceability, and Style JSON owns
76
+ its compiled-output identity. Hosted browser policy is managed outside repository artifacts. The
60
77
  top-level `provenance` block records the exact participating Tileflow package versions and the
61
78
  nearest package-manager lockfile's format and content hash, without embedding its local path;
62
79
  provenance remains outside every map revision. The same portable block is available to Hosted
@@ -90,6 +107,11 @@ unsubscribe();
90
107
  await session.close();
91
108
  ```
92
109
 
110
+ `getState()` and `getLastGoodArtifacts()` are borrowed synchronous views. Before starting async
111
+ work, call `session.acquireArtifacts(generation?)` and release the returned acquisition in `finally`.
112
+ A replacement stops new acquisitions of the old generation and deletes its snapshot after the last
113
+ release. `close()` waits for outstanding acquisitions.
114
+
93
115
  The bounded watcher follows the config, transitive local TypeScript/JavaScript/JSON imports, and
94
116
  effective local icon/font directory inputs. Generations are monotonic, overlapping refreshes are latest-wins, invalid
95
117
  edits retain the last good snapshot, and caller-supplied output directories can be ignored to avoid
@@ -107,8 +129,13 @@ const fetch = createTileflowDevRequestHandler({
107
129
  session,
108
130
  scene: 'madrid-mobile',
109
131
  });
132
+
133
+ // On server shutdown:
134
+ await Promise.all([fetch.close(), session.close()]);
110
135
  ```
111
136
 
137
+ The handler does not close a caller-owned session.
138
+
112
139
  Map preview uses the exported map's `view` and accepts one concrete `theme`; scene preview uses its
113
140
  committed concrete theme, camera, and CSS viewport metadata from that same map. A scene does not
114
141
  repeat the map ID because its owner is implicit.
@@ -175,18 +202,10 @@ pipeline. After inheritance resolves, a map with any text layer must have exactl
175
202
  produced by the style's `text-font` arrays.
176
203
 
177
204
  The resulting style records strict `tileflow:fontFaces` metadata. Preview, capture, and browser
178
- framework adapters load those generic definitions before constructing MapLibre. Hosted preparation
179
- also emits one canonical `tileflow-font-bundle-v1` closure containing only selected faces and their
180
- license bytes. Its manifest SHA-256 is the sole content identity; Hosted adds an opaque project-owned
181
- storage ID. Deploy uploads that bundle before the Style and then replaces provisional sources with
182
- the exact immutable ID URLs confirmed by Hosted. A derived map that declares `glyphs` replaces the
183
- inherited local provider atomically; the URL-backed map is complete as declared and independent of
184
- its World selection.
185
-
186
- That upload and binding contract is implemented, but it is not by itself a production-availability
187
- promise. The matching Hosted rollout candidate adds DB-backed project ownership, organization quota,
188
- durable deployment references, grace-based garbage collection, and deletion receipts; availability
189
- still requires that matching migration, API, and SDK pair to be promoted together.
205
+ framework adapters load those definitions before constructing MapLibre. Hosted deploy rejects a
206
+ prepared local-font bundle before authentication until managed font storage is available. A derived
207
+ map that declares `glyphs` replaces the inherited local provider atomically; the URL-backed map is
208
+ complete as declared and independent of its World selection.
190
209
 
191
210
  For Streets styles whose vegetation layer declares `tileflow:vegetation-mode = 3d`, the built-in
192
211
  preview uses the same portable circle fallback as capture and the published framework adapters by
@@ -361,13 +380,14 @@ export default defineMap({
361
380
  Directories apply left to right. `<id>.<ext>` publishes an icon as `<id>`;
362
381
  `<id>.pattern.<ext>` publishes the intrinsic-size pattern as `<id>`. The published ID must already
363
382
  be canonical lower-kebab-case. A later file replaces an earlier file only for the same exact ID;
364
- case-only collisions fail. Package maps export `streetsIcons`, `ferrarisIcons`,
365
- `haradIcons`, `siegfriedIcons`, `soundingsIcons`, `cyberpunkIcons`, `matrixIcons`, and `verdantIcons`
366
- directory descriptors from `@tileflow/maps`. Cyberpunk, Matrix, and Siegfried also export
367
- `cyberpunkFonts`, `matrixFonts`, and `siegfriedFonts`. Preparation resolves package descriptors inside their owning
368
- package, checks real-path containment, and compiles them through the same pipeline as a
369
- config-relative directory. There are no built-in/source/sprite selectors, mappings, icon-specific
370
- inheritance, or compatibility aliases.
383
+ case-only collisions fail. Package maps export `streetsIcons`, `baedekerIcons`, `ferrarisIcons`,
384
+ `haradIcons`, `siegfriedIcons`, `soundingsIcons`, `cyberpunkIcons`, `matrixIcons`, and
385
+ `verdantIcons`, and `sanFrancistoIcons` directory descriptors from `@tileflow/maps`. Cyberpunk,
386
+ Matrix, Baedeker, and Siegfried also export `cyberpunkFonts`, `matrixFonts`, `baedekerFonts`, and
387
+ `siegfriedFonts`. Preparation
388
+ resolves package descriptors inside their owning package, checks real-path containment, and
389
+ compiles them through the same pipeline as a config-relative directory. There are no
390
+ built-in/source/sprite selectors, mappings, icon-specific inheritance, or compatibility aliases.
371
391
 
372
392
  Local directories resolve from the directory containing the selected `tileflow.config.ts`, while
373
393
  the workspace `cwd` remains their containment boundary. Canonical local syntax starts with `./` or
@@ -401,9 +421,9 @@ try {
401
421
  The inspection resolves one config load into sorted maps, root-to-leaf lineage, declared paths, and
402
422
  leaf-level merge provenance. Its `themeContract` exposes the default/system mapping, shared token
403
423
  schema, concrete resolved token values, typography and lighting, differences from the default, and
404
- stable `THEME_IMPLICIT_FIXED` diagnostics across modules, terrain, and compiler-owned effects. Each
405
- diagnostic carries a semantic scope and, for compiler effects, its owner, target, and effect kind,
406
- plus machine-readable severity and remediation. Colors, fonts, and images are followed through
424
+ stable `THEME_IMPLICIT_FIXED` diagnostics across modules, render stacks, and terrain. Each
425
+ diagnostic carries a semantic scope and, for module values, its owner, plus machine-readable
426
+ severity and remediation. Colors, fonts, and images are followed through
407
427
  expression outputs; numeric diagnostics intentionally cover only direct visual scalars, excluding
408
428
  expression operands, zoom stops, tuples, placement, priority, and other structural numbers.
409
429
  Agents can therefore edit semantic roles without
@@ -412,6 +432,26 @@ URL queries, data URLs, or recognized secret formats. Structured summaries and d
412
432
  same required schema-version-1 fields and bounded safe suggestions so consumers do not need to
413
433
  parse human prose.
414
434
 
435
+ ## Bounded PMTiles resource inspection
436
+
437
+ Node tooling can inspect one local PMTiles archive without reading it completely:
438
+
439
+ ```ts
440
+ import {inspectTileflowPmtiles} from '@tileflow/dev/tilesets';
441
+
442
+ const inspection = await inspectTileflowPmtiles('./data/stores.pmtiles', {
443
+ includeValues: ['category', 'status'],
444
+ });
445
+ ```
446
+
447
+ Inspection schema 1 separates the authoritative PMTiles header and TileJSON `vector_layers` metadata
448
+ from deterministic bounded MVT observations. Each sampled field reports present/missing feature
449
+ counts, observed primitive types, capped distinct-value cardinality, numeric min/max, and explicit
450
+ truncation. Values are returned only for requested portable field names, with at most 32 requested
451
+ fields, 16 values per field, and 256 characters per string. Sampling reads at most eight tiles,
452
+ 20,000 features, or 24 MB of tile data; `sample: false` returns only authoritative metadata and does
453
+ not accept `includeValues`.
454
+
415
455
  ## Bounded vector-feature inspection
416
456
 
417
457
  Custom Node tooling can inspect only the features visible near a configured camera without opening
@@ -452,14 +492,18 @@ const result = await compileTileflowIconPackages(internalCatalog, {
452
492
  ```
453
493
 
454
494
  Streets declares `[streetsIcons]` and keeps light/dark image-token targets in that one closure;
455
- Cyberpunk and Matrix independently declare `[cyberpunkIcons]` and `[matrixIcons]`. Ferraris, Härad,
456
- Siegfried, Soundings, and Verdant declare only `[ferrarisIcons]`, `[haradIcons]`, `[siegfriedIcons]`,
457
- `[soundingsIcons]`, and `[verdantIcons]`, respectively. No official root composes another map's
458
- assets even though all use the semantic Streets compiler ABI. Härad's directory contains nine original Tileflow
459
- patterns inspired by Lantmäteriet's CC0 Häradsekonomiska kartan series from 1859–1934. Soundings owns ten
460
- original nautical symbols and patterns. An application map may inherit a root's exact array,
461
- replace it, clear it with `[]`, or
462
- compose it explicitly with a spread.
495
+ Cyberpunk and Matrix independently declare `[cyberpunkIcons]` and `[matrixIcons]`. Baedeker,
496
+ Ferraris, Härad, Siegfried, Soundings, Verdant, and San Francisto declare only `[baedekerIcons]`,
497
+ `[ferrarisIcons]`, `[haradIcons]`, `[siegfriedIcons]`, `[soundingsIcons]`, `[verdantIcons]`, and
498
+ `[sanFrancistoIcons]`, respectively. No official root composes another map's assets even though all
499
+ use the semantic compiler ABI. Baedeker's directory contains eight original travel-atlas patterns;
500
+ its browser-derived Mapterhorn contours use runtime terrain tiles and are not part of the icon
501
+ package. Härad's directory contains nine original Tileflow patterns inspired by Lantmäteriet's CC0
502
+ Häradsekonomiska kartan series from 1859–1934. Soundings owns ten original nautical symbols and
503
+ patterns. San Francisto owns four technical blueprint patterns and one schematic POI node; its
504
+ unbundled Mapterhorn contours remain runtime terrain, and its text uses the canonical Noto Sans
505
+ glyph provider. An application map may inherit a root's exact array, replace it, clear it with `[]`,
506
+ or compose it explicitly with a spread.
463
507
  `modules.poi.icons: false` or a disabled POI module suppresses POI icon layers without moving asset
464
508
  ownership into dev. POI density is the numeric producer threshold 1–5; it is not an asset-provider
465
509
  preset.
@@ -1,9 +1,27 @@
1
1
  import { TileflowStyleOptions, MapLibreStyle } from '@tileflow/core';
2
- import { TileflowMapBuildManifestV1, TileflowBuildCatalog, TileflowStyleInspection, TileflowBuildStyles, TileflowMapBuildProvenanceV1, TileflowPreparedMapAssets } from '@tileflow/core/build';
2
+ import { TileflowBuildCatalog, TileflowBuildStyles, TileflowMapBuildManifestV1, TileflowStyleInspection, TileflowMapBuildProvenanceV1, TileflowPreparedMapAssets } from '@tileflow/core/build';
3
3
  import { TileflowRuntimeManifest } from '@tileflow/core/manifest';
4
4
  import { TileflowBuildAsset, PreparedTileflowBuildCatalog, TileflowSourceCatalog, PreparedTileflowCatalog } from './icons.js';
5
5
  export { defaultTileflowConfigPath } from './config.js';
6
6
 
7
+ type TileflowLocalTilesetFile = Readonly<{
8
+ byteLength: number;
9
+ etag: string;
10
+ fileName: string;
11
+ logicalId: string;
12
+ sourcePath: string;
13
+ }>;
14
+ declare function prepareTileflowLocalTilesets(project: TileflowBuildCatalog, styles: TileflowBuildStyles, options: {
15
+ assetBaseUrl: string;
16
+ baseDirectory: string;
17
+ cwd: string;
18
+ }): Promise<{
19
+ dispose(): Promise<void>;
20
+ files: TileflowLocalTilesetFile[];
21
+ styles: TileflowBuildStyles;
22
+ watchPaths: string[];
23
+ }>;
24
+
7
25
  declare const tileflowArtifactSessionSchemaVersion: 1;
8
26
  type TileflowArtifactDiagnostic = {
9
27
  code?: string;
@@ -31,9 +49,18 @@ type TileflowArtifactSessionOptions = TileflowBuildArtifactsOptions & {
31
49
  ignoredPaths?: string[];
32
50
  watch?: boolean;
33
51
  };
52
+ type TileflowArtifactAcquisition = Readonly<{
53
+ artifacts: TileflowBuildArtifacts;
54
+ generation: number;
55
+ release(): Promise<void>;
56
+ }>;
34
57
  type TileflowArtifactSession = {
58
+ /** Pins the current generation for asynchronous work; the caller must release it. */
59
+ acquireArtifacts(generation?: number): TileflowArtifactAcquisition | undefined;
35
60
  close(): Promise<void>;
61
+ /** Borrowed synchronous view. Use acquireArtifacts() before retaining it across an await. */
36
62
  getLastGoodArtifacts(): TileflowBuildArtifacts | undefined;
63
+ /** Ready-state artifacts are a borrowed synchronous view. */
37
64
  getState(): TileflowArtifactSessionState;
38
65
  refresh(reason?: string): Promise<void>;
39
66
  subscribe(listener: (state: TileflowArtifactSessionState) => void): () => void;
@@ -74,14 +101,20 @@ type TileflowBuildArtifactsOptions = {
74
101
  /** Build a memory-only compiler sidecar for local authoring tools. */
75
102
  inspection?: boolean;
76
103
  styleBaseUrl?: string;
104
+ /** Local tools may snapshot local PMTiles; production output must resolve them explicitly. */
105
+ target?: 'local' | 'production';
77
106
  };
78
107
  type TileflowBuildStyleInspections = Record<string, Record<string, TileflowStyleInspection>>;
79
108
  /** Compatibility shape consumed by sessions and capture callers. */
80
109
  type TileflowBuildArtifacts = {
81
110
  assets: TileflowBuildAsset[];
82
111
  buildManifest: TileflowMapBuildManifestV1;
112
+ /** Releases local immutable snapshot references owned by this artifact generation. */
113
+ dispose?: () => Promise<void>;
83
114
  manifest: TileflowRuntimeManifest;
84
115
  project: TileflowBuildCatalog;
116
+ /** Local-only archive ports. Paths never enter serialized build artifacts. */
117
+ localTilesets?: TileflowLocalTilesetFile[];
85
118
  /** Optional local-only provenance. It is never serialized as a build artifact. */
86
119
  styleInspections?: TileflowBuildStyleInspections;
87
120
  styles: TileflowBuildStyles;
@@ -105,7 +138,7 @@ type TileflowArtifactPlan = TileflowBuildArtifacts & {
105
138
  schemaVersion: typeof tileflowArtifactPlanSchemaVersion;
106
139
  sourceProject: TileflowSourceCatalog;
107
140
  };
108
- type CreateTileflowArtifactPlanOptions = Pick<TileflowBuildArtifactsOptions, 'apiBaseUrl' | 'assetBaseUrl' | 'inspection' | 'styleBaseUrl'> & {
141
+ type CreateTileflowArtifactPlanOptions = Pick<TileflowBuildArtifactsOptions, 'apiBaseUrl' | 'assetBaseUrl' | 'inspection' | 'styleBaseUrl' | 'target'> & {
109
142
  inputFiles?: readonly string[];
110
143
  };
111
144
  type WriteTileflowArtifactPlanOptions = {
@@ -119,6 +152,10 @@ declare class TileflowHostedManifestOverwriteError extends Error {
119
152
  readonly code: "HOSTED_MANIFEST_OVERWRITE_REFUSED";
120
153
  constructor(path: string);
121
154
  }
155
+ declare class TileflowLocalTilesetProductionError extends Error {
156
+ readonly code: "TF_LOCAL_TILESET_PRODUCTION_UNRESOLVED";
157
+ constructor();
158
+ }
122
159
  declare function createTileflowManifest(project: TileflowBuildCatalog, options?: TileflowManifestOptions): TileflowRuntimeManifest;
123
160
  declare function createTileflowStyle(project: TileflowBuildCatalog, mapName: string, options?: TileflowStyleOptions): MapLibreStyle;
124
161
  declare function createTileflowStyles(project: TileflowBuildCatalog, options?: Omit<TileflowStyleOptions, 'preparedAssets' | 'theme'> & {
@@ -139,14 +176,16 @@ declare function refreshTileflowArtifactSession(session: TileflowArtifactSession
139
176
  reason: string;
140
177
  }): Promise<boolean>;
141
178
  declare function writeTileflowBuildArtifacts(options: WriteTileflowBuildArtifactsOptions): Promise<TileflowArtifactPlan>;
179
+ declare function disposeTileflowBuildArtifacts(artifacts: Pick<TileflowBuildArtifacts, 'dispose'>): Promise<void>;
142
180
  /**
143
181
  * Replaces one managed artifact generation and records its exact file inventory. Unmanaged files
144
182
  * are never scanned or removed. A caught filesystem failure restores every previous managed file.
145
183
  */
146
184
  declare function writeTileflowArtifactPlan(artifacts: TileflowArtifactPlan, options: WriteTileflowArtifactPlanOptions): Promise<void>;
185
+ declare function assertNoLocalTilesetsForProduction(artifacts: Pick<TileflowBuildArtifacts, 'localTilesets'>): void;
147
186
  /** Prevents a framework build from silently replacing the frontend's Hosted delivery contract. */
148
187
  declare function assertTileflowSelfHostedManifestTarget(manifestPath: string, options?: {
149
188
  overwriteHostedManifest?: boolean;
150
189
  }): Promise<void>;
151
190
 
152
- export { type CreateTileflowArtifactPlanOptions, PreparedTileflowBuildCatalog, PreparedTileflowCatalog, type TileflowArtifactDiagnostic, type TileflowArtifactFile, type TileflowArtifactInputGraph, type TileflowArtifactPlan, type TileflowArtifactSession, type TileflowArtifactSessionOptions, type TileflowArtifactSessionState, type TileflowBuildArtifacts, type TileflowBuildArtifactsOptions, TileflowBuildAsset, type TileflowBuildStyleInspections, TileflowHostedManifestOverwriteError, type TileflowManifestOptions, TileflowSourceCatalog, type WriteTileflowArtifactPlanOptions, type WriteTileflowBuildArtifactsOptions, assertTileflowSelfHostedManifestTarget, createTileflowArtifactDiagnostics, createTileflowArtifactPlan, createTileflowArtifactSession, createTileflowBuildArtifacts, createTileflowBuildProvenance, createTileflowManifest, createTileflowStyle, createTileflowStyles, getTileflowArtifactFiles, getTileflowAssetBasePath, getTileflowAssetFileName, getTileflowWatchPaths, isTileflowArtifactInputPath, joinTileflowPublicUrl, normalizeTileflowBasePath, refreshTileflowArtifactSession, resolveTileflowArtifactPublicUrls, tileflowArtifactInventoryFileName, tileflowArtifactPlanSchemaVersion, tileflowArtifactSessionSchemaVersion, writeTileflowArtifactPlan, writeTileflowBuildArtifacts };
191
+ export { type CreateTileflowArtifactPlanOptions, PreparedTileflowBuildCatalog, PreparedTileflowCatalog, type TileflowArtifactAcquisition, type TileflowArtifactDiagnostic, type TileflowArtifactFile, type TileflowArtifactInputGraph, type TileflowArtifactPlan, type TileflowArtifactSession, type TileflowArtifactSessionOptions, type TileflowArtifactSessionState, type TileflowBuildArtifacts, type TileflowBuildArtifactsOptions, TileflowBuildAsset, type TileflowBuildStyleInspections, TileflowHostedManifestOverwriteError, type TileflowLocalTilesetFile, TileflowLocalTilesetProductionError, type TileflowManifestOptions, TileflowSourceCatalog, type WriteTileflowArtifactPlanOptions, type WriteTileflowBuildArtifactsOptions, assertNoLocalTilesetsForProduction, assertTileflowSelfHostedManifestTarget, createTileflowArtifactDiagnostics, createTileflowArtifactPlan, createTileflowArtifactSession, createTileflowBuildArtifacts, createTileflowBuildProvenance, createTileflowManifest, createTileflowStyle, createTileflowStyles, disposeTileflowBuildArtifacts, getTileflowArtifactFiles, getTileflowAssetBasePath, getTileflowAssetFileName, getTileflowWatchPaths, isTileflowArtifactInputPath, joinTileflowPublicUrl, normalizeTileflowBasePath, prepareTileflowLocalTilesets, refreshTileflowArtifactSession, resolveTileflowArtifactPublicUrls, tileflowArtifactInventoryFileName, tileflowArtifactPlanSchemaVersion, tileflowArtifactSessionSchemaVersion, writeTileflowArtifactPlan, writeTileflowBuildArtifacts };
package/dist/artifacts.js CHANGED
@@ -1,5 +1,7 @@
1
1
  import {
2
2
  TileflowHostedManifestOverwriteError,
3
+ TileflowLocalTilesetProductionError,
4
+ assertNoLocalTilesetsForProduction,
3
5
  assertTileflowSelfHostedManifestTarget,
4
6
  createTileflowArtifactDiagnostics,
5
7
  createTileflowArtifactPlan,
@@ -9,32 +11,37 @@ import {
9
11
  createTileflowManifest,
10
12
  createTileflowStyle,
11
13
  createTileflowStyles,
14
+ disposeTileflowBuildArtifacts,
12
15
  getTileflowArtifactFiles,
13
16
  getTileflowWatchPaths,
14
17
  isTileflowArtifactInputPath,
18
+ prepareTileflowLocalTilesets,
15
19
  refreshTileflowArtifactSession,
16
20
  tileflowArtifactInventoryFileName,
17
21
  tileflowArtifactPlanSchemaVersion,
18
22
  tileflowArtifactSessionSchemaVersion,
19
23
  writeTileflowArtifactPlan,
20
24
  writeTileflowBuildArtifacts
21
- } from "./chunk-O7PE6FB2.js";
25
+ } from "./chunk-XTRHREXO.js";
26
+ import "./chunk-ONYQNLNA.js";
22
27
  import {
23
28
  getTileflowAssetBasePath,
24
29
  getTileflowAssetFileName,
25
30
  joinTileflowPublicUrl,
26
31
  normalizeTileflowBasePath,
27
32
  resolveTileflowArtifactPublicUrls
28
- } from "./chunk-VEB43KDS.js";
29
- import "./chunk-BALG4DSG.js";
33
+ } from "./chunk-RSBV4L2Y.js";
34
+ import "./chunk-CENQR5Q2.js";
30
35
  import "./chunk-BL3FK4GO.js";
31
36
  import "./chunk-KDFTE4Q5.js";
32
37
  import {
33
38
  defaultTileflowConfigPath
34
- } from "./chunk-BKHIZ7H2.js";
39
+ } from "./chunk-6MGFMKG3.js";
35
40
  import "./chunk-D4OE4ITL.js";
36
41
  export {
37
42
  TileflowHostedManifestOverwriteError,
43
+ TileflowLocalTilesetProductionError,
44
+ assertNoLocalTilesetsForProduction,
38
45
  assertTileflowSelfHostedManifestTarget,
39
46
  createTileflowArtifactDiagnostics,
40
47
  createTileflowArtifactPlan,
@@ -45,6 +52,7 @@ export {
45
52
  createTileflowStyle,
46
53
  createTileflowStyles,
47
54
  defaultTileflowConfigPath,
55
+ disposeTileflowBuildArtifacts,
48
56
  getTileflowArtifactFiles,
49
57
  getTileflowAssetBasePath,
50
58
  getTileflowAssetFileName,
@@ -52,6 +60,7 @@ export {
52
60
  isTileflowArtifactInputPath,
53
61
  joinTileflowPublicUrl,
54
62
  normalizeTileflowBasePath,
63
+ prepareTileflowLocalTilesets,
55
64
  refreshTileflowArtifactSession,
56
65
  resolveTileflowArtifactPublicUrls,
57
66
  tileflowArtifactInventoryFileName,
@@ -8,6 +8,7 @@ import { existsSync, realpathSync } from "fs";
8
8
  import { createRequire } from "module";
9
9
  import { dirname, resolve, sep } from "path";
10
10
  import {
11
+ parseResolvedTileflowMap,
11
12
  parseTileflowMap,
12
13
  tileflowCaptureSceneNameSchema,
13
14
  TileflowResolvedMapValidationError
@@ -66,7 +67,7 @@ function assertValidTileflowConfig(project) {
66
67
  const messages = [];
67
68
  for (const [mapId, map] of Object.entries(project.maps)) {
68
69
  try {
69
- parseTileflowMap(map);
70
+ parseResolvedTileflowMap(map);
70
71
  } catch (error) {
71
72
  messages.push({
72
73
  level: "error",
@@ -139,10 +140,7 @@ function asTileflowBuildCatalog(input, options = {}) {
139
140
  }
140
141
  return {
141
142
  mapMetadata: Object.fromEntries(
142
- entries.map(([id, map2, lineage]) => [
143
- id,
144
- { id, lineage, root: map2.root, version: map2.version }
145
- ])
143
+ entries.map(([id, map2, lineage]) => [id, { id, lineage, version: map2.version }])
146
144
  ),
147
145
  maps: Object.fromEntries(entries.map(([id, map2]) => [id, map2])),
148
146
  ...scenes2.size > 0 ? { scenes: Object.fromEntries(scenes2) } : {}
@@ -161,7 +159,6 @@ function asTileflowBuildCatalog(input, options = {}) {
161
159
  [resolved.id]: {
162
160
  id: resolved.id,
163
161
  lineage: collectTileflowMapBuildLineage(map),
164
- root: resolved.root,
165
162
  version: resolved.version
166
163
  }
167
164
  },
@@ -11,7 +11,7 @@ import {
11
11
  compareCodeUnits,
12
12
  hashTileflowIconPackageManifest,
13
13
  hashTileflowRenderedIconPixels,
14
- parseTileflowMap,
14
+ parseResolvedTileflowMap,
15
15
  serializeCanonicalJson,
16
16
  sha256Hex,
17
17
  tileflowIconIdPattern,
@@ -237,7 +237,7 @@ async function getMapIconRequests(project, cwd, baseDirectory, target, mapNames)
237
237
  for (const mapName of selectedNames) {
238
238
  const mapConfig = project.maps[mapName];
239
239
  if (!mapConfig) throw new Error(`Unknown Tileflow map: ${mapName}`);
240
- const resolvedMap = parseTileflowMap(mapConfig);
240
+ const resolvedMap = parseResolvedTileflowMap(mapConfig);
241
241
  try {
242
242
  const directories = await resolveTileflowAssetDirectories(resolvedMap.icons ?? [], {
243
243
  baseDirectory,