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

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.
@@ -0,0 +1,152 @@
1
+ import { TileflowStyleOptions, MapLibreStyle } from '@tileflow/core';
2
+ import { TileflowMapBuildManifestV1, TileflowBuildCatalog, TileflowStyleInspection, TileflowBuildStyles, TileflowMapBuildProvenanceV1, TileflowPreparedMapAssets } from '@tileflow/core/build';
3
+ import { TileflowRuntimeManifest } from '@tileflow/core/manifest';
4
+ import { TileflowBuildAsset, PreparedTileflowBuildCatalog, TileflowSourceCatalog, PreparedTileflowCatalog } from './icons.js';
5
+ export { defaultTileflowConfigPath } from './config.js';
6
+
7
+ declare const tileflowArtifactSessionSchemaVersion: 1;
8
+ type TileflowArtifactDiagnostic = {
9
+ code?: string;
10
+ message: string;
11
+ path: string;
12
+ phase?: string;
13
+ };
14
+ type TileflowArtifactSessionState = {
15
+ status: 'building';
16
+ generation: number;
17
+ lastGoodGeneration?: number;
18
+ } | {
19
+ status: 'ready';
20
+ generation: number;
21
+ artifacts: TileflowBuildArtifacts;
22
+ lastGoodGeneration: number;
23
+ } | {
24
+ status: 'invalid';
25
+ generation: number;
26
+ diagnostics: TileflowArtifactDiagnostic[];
27
+ lastGoodGeneration?: number;
28
+ };
29
+ type TileflowArtifactSessionOptions = TileflowBuildArtifactsOptions & {
30
+ debounceMs?: number;
31
+ ignoredPaths?: string[];
32
+ watch?: boolean;
33
+ };
34
+ type TileflowArtifactSession = {
35
+ close(): Promise<void>;
36
+ getLastGoodArtifacts(): TileflowBuildArtifacts | undefined;
37
+ getState(): TileflowArtifactSessionState;
38
+ refresh(reason?: string): Promise<void>;
39
+ subscribe(listener: (state: TileflowArtifactSessionState) => void): () => void;
40
+ };
41
+ declare function createTileflowArtifactDiagnostics(error: unknown, cwd: string): TileflowArtifactDiagnostic[];
42
+
43
+ /** Normalize a development route base. This is a URL pathname, never a filesystem path. */
44
+ declare function normalizeTileflowBasePath(value?: string): string;
45
+ /**
46
+ * Join a bundler public URL prefix to the Tileflow route without changing URL-reference kind.
47
+ * In particular, `./` and `../` remain path-relative rather than becoming root-relative.
48
+ */
49
+ declare function joinTileflowPublicUrl(publicBase: string, basePath: string): string;
50
+ /**
51
+ * Resolve the public URL at which a manifest is exposed and the URLs embedded inside its artifacts.
52
+ * Path-relative deployments use owner-relative references because the manifest already lives below
53
+ * the public prefix.
54
+ */
55
+ declare function resolveTileflowArtifactPublicUrls(publicBase: string, basePath: string): {
56
+ assetBaseUrl?: string;
57
+ publicBaseUrl: string;
58
+ styleBaseUrl: string;
59
+ };
60
+ /** Convert a validated route base to a bundler-relative asset prefix. */
61
+ declare function getTileflowAssetBasePath(basePath: string): string;
62
+ declare function getTileflowAssetFileName(basePath: string, fileName: string): string;
63
+
64
+ declare const tileflowArtifactPlanSchemaVersion: 1;
65
+ declare const tileflowArtifactInventoryFileName = ".tileflow-artifacts.json";
66
+ type TileflowManifestOptions = {
67
+ styleBaseUrl?: string;
68
+ };
69
+ type TileflowBuildArtifactsOptions = {
70
+ apiBaseUrl?: string;
71
+ assetBaseUrl?: string;
72
+ config?: string;
73
+ cwd?: string;
74
+ /** Build a memory-only compiler sidecar for local authoring tools. */
75
+ inspection?: boolean;
76
+ styleBaseUrl?: string;
77
+ };
78
+ type TileflowBuildStyleInspections = Record<string, Record<string, TileflowStyleInspection>>;
79
+ /** Compatibility shape consumed by sessions and capture callers. */
80
+ type TileflowBuildArtifacts = {
81
+ assets: TileflowBuildAsset[];
82
+ buildManifest: TileflowMapBuildManifestV1;
83
+ manifest: TileflowRuntimeManifest;
84
+ project: TileflowBuildCatalog;
85
+ /** Optional local-only provenance. It is never serialized as a build artifact. */
86
+ styleInspections?: TileflowBuildStyleInspections;
87
+ styles: TileflowBuildStyles;
88
+ watchPaths: string[];
89
+ };
90
+ type TileflowArtifactFile = TileflowBuildAsset;
91
+ type TileflowArtifactInputGraph = {
92
+ /** Exact executable config modules and data files observed during evaluation. */
93
+ files: string[];
94
+ /** Asset directories whose children can change without changing the config module. */
95
+ directories: string[];
96
+ };
97
+ /**
98
+ * Complete, deterministic output of compiling one prepared source generation.
99
+ * `sourceProject` is retained for diagnostics only; `project` is the portable runtime input.
100
+ */
101
+ type TileflowArtifactPlan = TileflowBuildArtifacts & {
102
+ files: TileflowArtifactFile[];
103
+ inputs: TileflowArtifactInputGraph;
104
+ project: PreparedTileflowBuildCatalog;
105
+ schemaVersion: typeof tileflowArtifactPlanSchemaVersion;
106
+ sourceProject: TileflowSourceCatalog;
107
+ };
108
+ type CreateTileflowArtifactPlanOptions = Pick<TileflowBuildArtifactsOptions, 'apiBaseUrl' | 'assetBaseUrl' | 'inspection' | 'styleBaseUrl'> & {
109
+ inputFiles?: readonly string[];
110
+ };
111
+ type WriteTileflowArtifactPlanOptions = {
112
+ cwd?: string;
113
+ outDir: string;
114
+ /** Explicit escape hatch for replacing a Hosted delivery manifest with self-hosted artifacts. */
115
+ overwriteHostedManifest?: boolean;
116
+ };
117
+ type WriteTileflowBuildArtifactsOptions = TileflowBuildArtifactsOptions & WriteTileflowArtifactPlanOptions;
118
+ declare class TileflowHostedManifestOverwriteError extends Error {
119
+ readonly code: "HOSTED_MANIFEST_OVERWRITE_REFUSED";
120
+ constructor(path: string);
121
+ }
122
+ declare function createTileflowManifest(project: TileflowBuildCatalog, options?: TileflowManifestOptions): TileflowRuntimeManifest;
123
+ declare function createTileflowStyle(project: TileflowBuildCatalog, mapName: string, options?: TileflowStyleOptions): MapLibreStyle;
124
+ declare function createTileflowStyles(project: TileflowBuildCatalog, options?: Omit<TileflowStyleOptions, 'preparedAssets' | 'theme'> & {
125
+ mapAssets?: Readonly<Record<string, TileflowPreparedMapAssets>>;
126
+ }): TileflowBuildStyles;
127
+ /** Compiles only a prepared project, keeping local source resolution out of core compilation. */
128
+ declare function createTileflowArtifactPlan(prepared: PreparedTileflowCatalog, options?: CreateTileflowArtifactPlanOptions): Promise<TileflowArtifactPlan>;
129
+ declare function createTileflowBuildArtifacts(options?: TileflowBuildArtifactsOptions): Promise<TileflowArtifactPlan>;
130
+ declare function getTileflowArtifactFiles(artifacts: TileflowBuildArtifacts): TileflowArtifactFile[];
131
+ /** Resolve portable build provenance without making it part of any map authoring revision. */
132
+ declare function createTileflowBuildProvenance(cwd: string): Promise<TileflowMapBuildProvenanceV1>;
133
+ declare function createTileflowArtifactSession(options?: TileflowArtifactSessionOptions): Promise<TileflowArtifactSession>;
134
+ declare function getTileflowWatchPaths(options?: Pick<TileflowBuildArtifactsOptions, 'config' | 'cwd'>): Promise<string[]>;
135
+ declare function isTileflowArtifactInputPath(inputs: TileflowArtifactInputGraph, path: string): boolean;
136
+ /** Shared refresh gate for adapters that receive filesystem or framework lifecycle events. */
137
+ declare function refreshTileflowArtifactSession(session: TileflowArtifactSession, options: {
138
+ inputPath?: string;
139
+ reason: string;
140
+ }): Promise<boolean>;
141
+ declare function writeTileflowBuildArtifacts(options: WriteTileflowBuildArtifactsOptions): Promise<TileflowArtifactPlan>;
142
+ /**
143
+ * Replaces one managed artifact generation and records its exact file inventory. Unmanaged files
144
+ * are never scanned or removed. A caught filesystem failure restores every previous managed file.
145
+ */
146
+ declare function writeTileflowArtifactPlan(artifacts: TileflowArtifactPlan, options: WriteTileflowArtifactPlanOptions): Promise<void>;
147
+ /** Prevents a framework build from silently replacing the frontend's Hosted delivery contract. */
148
+ declare function assertTileflowSelfHostedManifestTarget(manifestPath: string, options?: {
149
+ overwriteHostedManifest?: boolean;
150
+ }): Promise<void>;
151
+
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 };
@@ -0,0 +1,62 @@
1
+ import {
2
+ TileflowHostedManifestOverwriteError,
3
+ assertTileflowSelfHostedManifestTarget,
4
+ createTileflowArtifactDiagnostics,
5
+ createTileflowArtifactPlan,
6
+ createTileflowArtifactSession,
7
+ createTileflowBuildArtifacts,
8
+ createTileflowBuildProvenance,
9
+ createTileflowManifest,
10
+ createTileflowStyle,
11
+ createTileflowStyles,
12
+ getTileflowArtifactFiles,
13
+ getTileflowWatchPaths,
14
+ isTileflowArtifactInputPath,
15
+ refreshTileflowArtifactSession,
16
+ tileflowArtifactInventoryFileName,
17
+ tileflowArtifactPlanSchemaVersion,
18
+ tileflowArtifactSessionSchemaVersion,
19
+ writeTileflowArtifactPlan,
20
+ writeTileflowBuildArtifacts
21
+ } from "./chunk-O7PE6FB2.js";
22
+ import {
23
+ getTileflowAssetBasePath,
24
+ getTileflowAssetFileName,
25
+ joinTileflowPublicUrl,
26
+ normalizeTileflowBasePath,
27
+ resolveTileflowArtifactPublicUrls
28
+ } from "./chunk-VEB43KDS.js";
29
+ import "./chunk-BALG4DSG.js";
30
+ import "./chunk-BL3FK4GO.js";
31
+ import "./chunk-KDFTE4Q5.js";
32
+ import {
33
+ defaultTileflowConfigPath
34
+ } from "./chunk-BKHIZ7H2.js";
35
+ import "./chunk-D4OE4ITL.js";
36
+ export {
37
+ TileflowHostedManifestOverwriteError,
38
+ assertTileflowSelfHostedManifestTarget,
39
+ createTileflowArtifactDiagnostics,
40
+ createTileflowArtifactPlan,
41
+ createTileflowArtifactSession,
42
+ createTileflowBuildArtifacts,
43
+ createTileflowBuildProvenance,
44
+ createTileflowManifest,
45
+ createTileflowStyle,
46
+ createTileflowStyles,
47
+ defaultTileflowConfigPath,
48
+ getTileflowArtifactFiles,
49
+ getTileflowAssetBasePath,
50
+ getTileflowAssetFileName,
51
+ getTileflowWatchPaths,
52
+ isTileflowArtifactInputPath,
53
+ joinTileflowPublicUrl,
54
+ normalizeTileflowBasePath,
55
+ refreshTileflowArtifactSession,
56
+ resolveTileflowArtifactPublicUrls,
57
+ tileflowArtifactInventoryFileName,
58
+ tileflowArtifactPlanSchemaVersion,
59
+ tileflowArtifactSessionSchemaVersion,
60
+ writeTileflowArtifactPlan,
61
+ writeTileflowBuildArtifacts
62
+ };