@tileflow/dev 0.1.0-alpha.24 → 0.1.0-alpha.26

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
@@ -103,6 +103,9 @@ export async function createMapHandler() {
103
103
  The caller mounts `fetch` in its server and calls `close()` on shutdown. This factory does not open
104
104
  a listener. Sessions follow config imports and local asset inputs, retain the last good generation
105
105
  after invalid edits, and publish structured state changes through `subscribe()`.
106
+ Watching follows aliased working directories, including newly created or removed icon metadata.
107
+ A single startup consistency check complements ordinary watcher notifications; no recurring scan
108
+ is added.
106
109
 
107
110
  `getState()` and `getLastGoodArtifacts()` return borrowed synchronous views. Before asynchronous
108
111
  work, call `acquireArtifacts(generation?)` and release the acquisition in `finally`. A replaced
@@ -120,15 +123,28 @@ Invalid compiled styles throw `TileflowStyleValidationError` with bounded issues
120
123
  structured; do not return executable config, local paths, credentials, or complete generated byte
121
124
  arrays from a public endpoint.
122
125
 
123
- ## Locked Icon Set composition foundations
126
+ ## Locked Icon Set composition
124
127
 
125
128
  `composeTileflowIconSources(sources, {cwd, lock, cacheRoot, offline: true})` combines local/package
126
129
  directories and `iconSet('@team/set')` contributors into one effective sprite. Without an explicit
127
130
  lock object, it reads `tileflow.icons.lock.json` beside `baseDirectory` (default: `cwd`). It never
128
131
  resolves latest or writes the lock. The result contains the generated `package`, ordered
129
- `composition` receipt, effective `sourceIdentities`, replacement ordinals, and local watch paths.
132
+ `composition` receipt, effective `sourceIdentities`, declared `contributors`, effective `winners`,
133
+ replacement ordinals, local `watchPaths`, and the exact `watchFiles` that select the composition.
130
134
  Pass both the source identities and receipt to Core map-revision hashing.
131
135
 
136
+ This is the one normal icon-preparation path. `compileTileflowIconPackages`,
137
+ `prepareTileflowCatalogIcons`, `inspectTileflowIconCatalogs` and `getTileflowIconWatchPaths` all use
138
+ it, so `createTileflowBuildArtifacts`, `createTileflowArtifactSession`, and every adapter that
139
+ enters them accept the same explicit `icons` resolution options: `cacheRoot`, `offline`,
140
+ `deliveryOrigins`, `fetch` and `signal`. Nothing selects a cache, an origin, or a transport from
141
+ implicit process state, and no build or watch polls a catalog head. `prepareTileflowCatalogIcons`
142
+ returns `mapIconCompositions` alongside `mapIconSources`, and build-manifest entries carry the
143
+ receipt as `sourceAssets.iconComposition` with `mapRevisionSchemaVersion: 2`.
144
+
145
+ A map whose contributors are all local or package directories keeps its existing generated bytes,
146
+ manifest and content hash, and its build-manifest entry stays on the legacy v1 contract.
147
+
132
148
  The reader verifies each file length/checksum, PNG/index geometry, names, density pairing, and both
133
149
  per-icon pixel hashes. It copies decoded 1x and 2x cells independently, without resampling either.
134
150
  The existing directory compiler and this port share the same sprite packer. A sole shared set reuses
@@ -149,21 +165,26 @@ retirement support concurrent writers and corruption repair. Symlink entries are
149
165
  a disposable cache, not a security sandbox against another process controlling the same user
150
166
  account. Incomplete temporary entries are never accepted as published cache entries.
151
167
 
168
+ `readTileflowIconsLockfileText(directory)` returns the exact current lock bytes, or `null` when no
169
+ lock exists; those bytes are the only valid `expectedContents` for the next write.
152
170
  `writeTileflowIconsLockfile(directory, lock, expectedContents)` uses a whole-file compare-and-swap
153
171
  and atomic rename. A conflicting writer fails without overwriting pins. An interrupted writer leaves
154
172
  the previous complete lock intact; remove a stale `.writing` guard only after confirming that its
155
173
  writer has exited. Ordinary reads and Core validation never acquire write guards.
156
174
 
157
- The existing 256-effective-icon, 2048-atlas-dimension, 4 MiB/file, and 8 MiB/package bounds still
158
- apply. Several individually valid sets can exceed the effective map limit; composition fails
159
- explicitly instead of clipping. Cache and composition do not create Team resources or publish
160
- anything. Normal CLI/build/framework and Hosted command integration follows separately; those
161
- existing entry points currently reject shared descriptors rather than silently dropping them.
175
+ A package supports up to 1,000 effective icons, subject to a 2,048-pixel atlas dimension,
176
+ 4 MiB per generated file, and 8 MiB per package. Larger artwork can hit those limits before
177
+ 1,000 icons. Several individually valid sets can exceed the effective map limit; composition
178
+ fails explicitly instead of clipping. Cache and composition do not create Team resources or
179
+ publish anything. Every normal entry point composes declared shared descriptors through this path;
180
+ catalog publication and lock maintenance stay in the `tileflow` CLI, which is the only writer of
181
+ `tileflow.icons.lock.json` and the only caller that resolves `latest`.
162
182
 
163
183
  ## Detailed guides
164
184
 
165
185
  These references are also included under `docs/` in the installed package:
166
186
 
187
+ - [Native artifact preparation](https://github.com/tileflow/tileflow-sdk/blob/main/packages/dev/docs/native-artifacts.md): static compatibility, renderer-qualified output, and limitations.
167
188
  - [Artifact lifecycle](https://github.com/tileflow/tileflow-sdk/blob/main/packages/dev/docs/artifact-lifecycle.md): generations, immutable snapshots, provenance, and cleanup.
168
189
  - [Local comparison and inspection](https://github.com/tileflow/tileflow-sdk/blob/main/packages/dev/docs/local-comparison-workbench-and-compiler-inspection.md): workbench controls and preview-only models.
169
190
  - [Config diagnostics](https://github.com/tileflow/tileflow-sdk/blob/main/packages/dev/docs/structured-config-inspection-and-diagnostics.md): bounded, machine-readable inspection.
@@ -171,3 +192,9 @@ These references are also included under `docs/` in the installed package:
171
192
  - [Feature and icon inspection](https://github.com/tileflow/tileflow-sdk/blob/main/packages/dev/docs/bounded-vector-feature-inspection.md): supported sources, icon compilation, and delivered-pixel hashes.
172
193
 
173
194
  For an installed release, prefer its declarations and packaged guides over newer source on `main`.
195
+
196
+ ## Recolorable icons
197
+
198
+ Declare SDF defaults and optional stretch/content layout in `tileflow.icons.json` beside ordinary artwork. Preparation
199
+ verifies both densities and rejects mixed representations within one symbol layer, including
200
+ fallbacks and local overrides. See [Author recolorable and adaptable icons](https://github.com/tileflow/tileflow-sdk/blob/main/packages/dev/docs/native-icons.md) for the input profile, diagnostics and recovery.
@@ -5,6 +5,29 @@ and fonts are owned and published by `@tileflow/maps`; `@tileflow/dev` does not
5
5
  directory. Runtime dependencies are installed as separate npm packages, and their code and native
6
6
  binaries are not copied into the dev package.
7
7
 
8
+ ## Bitmap distance transform
9
+
10
+ `src/icon-distance.ts` adapts the alpha distance transform from bitmap-sdf 1.0.4 for bounded,
11
+ Node-only sprite preparation. The adaptation removes browser globals and adds input validation.
12
+ Source: <https://github.com/dy/bitmap-sdf>. License: MIT.
13
+
14
+ Copyright 2020 Dmitry Ivanov
15
+
16
+ Permission is hereby granted, free of charge, to any person obtaining a copy of this software and
17
+ associated documentation files (the “Software”), to deal in the Software without restriction,
18
+ including without limitation the rights to use, copy, modify, merge, publish, distribute,
19
+ sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is
20
+ furnished to do so, subject to the following conditions:
21
+
22
+ The above copyright notice and this permission notice shall be included in all copies or
23
+ substantial portions of the Software.
24
+
25
+ THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT
26
+ NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
27
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
28
+ DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
29
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
30
+
8
31
  ## Package-owned map fonts
9
32
 
10
33
  The generic font preparation pipeline reads map-owned TTF, OTF, and WOFF2 directories; it does not
@@ -1,7 +1,8 @@
1
- import { TileflowStyleOptions, MapLibreStyle } from '@tileflow/core';
2
- import { TileflowBuildCatalog, TileflowBuildStyles, TileflowMapBuildManifestV1, TileflowStyleInspection, TileflowMapBuildProvenanceV1, TileflowPreparedMapAssets } from '@tileflow/core/build';
1
+ import { MapLibreStyle, TileflowViewConfig, TileflowStyleOptions } from '@tileflow/core';
2
+ import { TileflowBuildCatalog, TileflowBuildStyles, TileflowMapBuildManifestV1, TileflowRendererDeploymentArtifact, TileflowStyleInspection, TileflowMapBuildProvenanceV1, TileflowPreparedMapAssets } from '@tileflow/core/build';
3
3
  import { TileflowRuntimeManifest } from '@tileflow/core/manifest';
4
- import { e as TileflowBuildAsset, P as PreparedTileflowBuildCatalog, r as TileflowSourceCatalog, d as PreparedTileflowCatalog } from './icons-CkLVtaP-.js';
4
+ import { TileflowRenderer, TileflowNativeBuildRecord } from '@tileflow/core/native-profile';
5
+ import { TileflowBuildAsset, TileflowIconResolutionOptions, PreparedTileflowBuildCatalog, TileflowSourceCatalog, PreparedTileflowCatalog } from './icons.js';
5
6
  export { defaultTileflowConfigPath } from './config.js';
6
7
 
7
8
  type TileflowLocalTilesetFile = Readonly<{
@@ -28,6 +29,10 @@ type TileflowArtifactDiagnostic = {
28
29
  message: string;
29
30
  path: string;
30
31
  phase?: string;
32
+ renderer?: 'native';
33
+ profile?: 'native-v1';
34
+ severity?: 'error';
35
+ suggestion?: string;
31
36
  };
32
37
  type TileflowArtifactSessionState = {
33
38
  status: 'building';
@@ -67,6 +72,24 @@ type TileflowArtifactSession = {
67
72
  };
68
73
  declare function createTileflowArtifactDiagnostics(error: unknown, cwd: string): TileflowArtifactDiagnostic[];
69
74
 
75
+ type Input = Readonly<{
76
+ mapId: string;
77
+ buildManifest: TileflowMapBuildManifestV1;
78
+ styles: Readonly<Record<string, MapLibreStyle>>;
79
+ teamSources: Readonly<Record<string, Readonly<{
80
+ tileset: string;
81
+ type: 'raster' | 'vector';
82
+ }>>>;
83
+ assets: readonly TileflowBuildAsset[];
84
+ view?: TileflowViewConfig;
85
+ }>;
86
+ /**
87
+ * Prepare both representations from the same already compiled, asset-bound web family.
88
+ * This has no network or publication port. Call it before any authenticated remote operation.
89
+ * Logical Hosted placeholders are validated syntactically without granting delivery authority.
90
+ */
91
+ declare function prepareTileflowHostedNativeDeployment(input: Input): Promise<TileflowRendererDeploymentArtifact>;
92
+
70
93
  /** Normalize a development route base. This is a URL pathname, never a filesystem path. */
71
94
  declare function normalizeTileflowBasePath(value?: string): string;
72
95
  /**
@@ -98,6 +121,15 @@ type TileflowBuildArtifactsOptions = {
98
121
  assetBaseUrl?: string;
99
122
  config?: string;
100
123
  cwd?: string;
124
+ /**
125
+ * Explicit shared Icon Set resolution settings for this build.
126
+ *
127
+ * Builds never resolve a catalog head. These options only choose the verified cache root,
128
+ * offline behavior, trusted delivery origins and the transport used to hydrate exact pins.
129
+ */
130
+ icons?: TileflowIconResolutionOptions;
131
+ /** Artifact renderer. Omission is identical to web; native uses a separate output directory. */
132
+ renderer?: TileflowRenderer;
101
133
  /** Build a memory-only compiler sidecar for local authoring tools. */
102
134
  inspection?: boolean;
103
135
  styleBaseUrl?: string;
@@ -109,6 +141,8 @@ type TileflowBuildStyleInspections = Record<string, Record<string, TileflowStyle
109
141
  type TileflowBuildArtifacts = {
110
142
  assets: TileflowBuildAsset[];
111
143
  buildManifest: TileflowMapBuildManifestV1;
144
+ /** Present only for native artifact preparation; never part of the runtime manifest. */
145
+ nativeBuild?: TileflowNativeBuildRecord;
112
146
  /** Releases local immutable snapshot references owned by this artifact generation. */
113
147
  dispose?: () => Promise<void>;
114
148
  manifest: TileflowRuntimeManifest;
@@ -138,7 +172,7 @@ type TileflowArtifactPlan = TileflowBuildArtifacts & {
138
172
  schemaVersion: typeof tileflowArtifactPlanSchemaVersion;
139
173
  sourceProject: TileflowSourceCatalog;
140
174
  };
141
- type CreateTileflowArtifactPlanOptions = Pick<TileflowBuildArtifactsOptions, 'apiBaseUrl' | 'assetBaseUrl' | 'inspection' | 'styleBaseUrl' | 'target'> & {
175
+ type CreateTileflowArtifactPlanOptions = Pick<TileflowBuildArtifactsOptions, 'apiBaseUrl' | 'assetBaseUrl' | 'inspection' | 'renderer' | 'styleBaseUrl' | 'target'> & {
142
176
  inputFiles?: readonly string[];
143
177
  };
144
178
  type WriteTileflowArtifactPlanOptions = {
@@ -188,4 +222,4 @@ declare function assertTileflowSelfHostedManifestTarget(manifestPath: string, op
188
222
  overwriteHostedManifest?: boolean;
189
223
  }): Promise<void>;
190
224
 
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 };
225
+ 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, TileflowIconResolutionOptions, 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, prepareTileflowHostedNativeDeployment, prepareTileflowLocalTilesets, refreshTileflowArtifactSession, resolveTileflowArtifactPublicUrls, tileflowArtifactInventoryFileName, tileflowArtifactPlanSchemaVersion, tileflowArtifactSessionSchemaVersion, writeTileflowArtifactPlan, writeTileflowBuildArtifacts };
package/dist/artifacts.js CHANGED
@@ -15,6 +15,7 @@ import {
15
15
  getTileflowArtifactFiles,
16
16
  getTileflowWatchPaths,
17
17
  isTileflowArtifactInputPath,
18
+ prepareTileflowHostedNativeDeployment,
18
19
  prepareTileflowLocalTilesets,
19
20
  refreshTileflowArtifactSession,
20
21
  tileflowArtifactInventoryFileName,
@@ -22,7 +23,7 @@ import {
22
23
  tileflowArtifactSessionSchemaVersion,
23
24
  writeTileflowArtifactPlan,
24
25
  writeTileflowBuildArtifacts
25
- } from "./chunk-XXVI42UZ.js";
26
+ } from "./chunk-QAMFAM3S.js";
26
27
  import "./chunk-ONYQNLNA.js";
27
28
  import {
28
29
  getTileflowAssetBasePath,
@@ -30,9 +31,9 @@ import {
30
31
  joinTileflowPublicUrl,
31
32
  normalizeTileflowBasePath,
32
33
  resolveTileflowArtifactPublicUrls
33
- } from "./chunk-RSBV4L2Y.js";
34
- import "./chunk-NUHSYLLS.js";
35
- import "./chunk-BL3FK4GO.js";
34
+ } from "./chunk-UTRO4IBQ.js";
35
+ import "./chunk-EJPVUSX4.js";
36
+ import "./chunk-7C4F6GAX.js";
36
37
  import "./chunk-KDFTE4Q5.js";
37
38
  import {
38
39
  defaultTileflowConfigPath
@@ -60,6 +61,7 @@ export {
60
61
  isTileflowArtifactInputPath,
61
62
  joinTileflowPublicUrl,
62
63
  normalizeTileflowBasePath,
64
+ prepareTileflowHostedNativeDeployment,
63
65
  prepareTileflowLocalTilesets,
64
66
  refreshTileflowArtifactSession,
65
67
  resolveTileflowArtifactPublicUrls,
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  createTileflowCommandSummary
3
- } from "./chunk-LNCTVFUD.js";
3
+ } from "./chunk-XHJBCVBB.js";
4
4
  import {
5
5
  assertValidTileflowStyle,
6
6
  sanitizeDiagnosticSecrets
@@ -52,7 +52,7 @@ async function resolveTileflowAssetDirectories(directories, options) {
52
52
  const result = [];
53
53
  const seen = /* @__PURE__ */ new Map();
54
54
  for (const [index, directory] of directories.entries()) {
55
- const configPath = `${options.configPath}.${index}`;
55
+ const configPath = `${options.configPath}.${index + (options.ordinalOffset ?? 0)}`;
56
56
  let candidate;
57
57
  let containmentRoot;
58
58
  let packageOwned = false;