@tileflow/dev 0.1.0-alpha.4 → 0.1.0-alpha.40
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/LICENSE +201 -0
- package/README.md +257 -5
- package/THIRD_PARTY_NOTICES.md +309 -0
- package/dist/artifacts.d.ts +269 -0
- package/dist/artifacts.js +98 -0
- package/dist/chunk-AQUGMUZW.js +324 -0
- package/dist/chunk-AVJMTXW5.js +3147 -0
- package/dist/chunk-C4VPHZ3F.js +4062 -0
- package/dist/chunk-D4OE4ITL.js +13 -0
- package/dist/chunk-FOMTSCOP.js +671 -0
- package/dist/chunk-KDFTE4Q5.js +156 -0
- package/dist/chunk-ONYQNLNA.js +1108 -0
- package/dist/chunk-RTU7TD4M.js +172 -0
- package/dist/chunk-XHJBCVBB.js +241 -0
- package/dist/config.d.ts +33 -0
- package/dist/config.js +27 -0
- package/dist/fonts.d.ts +47 -0
- package/dist/fonts.js +16 -0
- package/dist/icons-BIHpw5Zy.d.ts +417 -0
- package/dist/icons.d.ts +3 -0
- package/dist/icons.js +41 -0
- package/dist/inspect.d.ts +149 -0
- package/dist/inspect.js +805 -0
- package/dist/inspector-browser.js +16955 -0
- package/dist/inspector-observer.js +95 -0
- package/dist/preview-assets-ATLLYY72.js +103 -0
- package/dist/preview.d.ts +31 -0
- package/dist/preview.js +1972 -0
- package/dist/server.d.ts +89 -0
- package/dist/server.js +3657 -0
- package/dist/tilesets.d.ts +89 -0
- package/dist/tilesets.js +6 -0
- package/dist/validation.d.ts +65 -0
- package/dist/validation.js +24 -0
- package/package.json +77 -13
- package/ui-fonts/hubot-sans-OFL.txt +93 -0
- package/ui-fonts/hubot-sans.woff2 +0 -0
- package/ui-fonts/inter-OFL.txt +92 -0
- package/ui-fonts/inter.woff2 +0 -0
- package/ui-fonts/jetbrains-mono-OFL.txt +93 -0
- package/ui-fonts/jetbrains-mono.woff2 +0 -0
- package/ui-fonts/mona-sans-OFL.txt +93 -0
- package/ui-fonts/mona-sans.woff2 +0 -0
- package/dist/index.d.ts +0 -54
- package/dist/index.js +0 -314
package/LICENSE
ADDED
|
@@ -0,0 +1,201 @@
|
|
|
1
|
+
Apache License
|
|
2
|
+
Version 2.0, January 2004
|
|
3
|
+
http://www.apache.org/licenses/
|
|
4
|
+
|
|
5
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
6
|
+
|
|
7
|
+
1. Definitions.
|
|
8
|
+
|
|
9
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
|
10
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
|
11
|
+
|
|
12
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
|
13
|
+
the copyright owner that is granting the License.
|
|
14
|
+
|
|
15
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
|
16
|
+
other entities that control, are controlled by, or are under common
|
|
17
|
+
control with that entity. For the purposes of this definition,
|
|
18
|
+
"control" means (i) the power, direct or indirect, to cause the
|
|
19
|
+
direction or management of such entity, whether by contract or
|
|
20
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
21
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
22
|
+
|
|
23
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
|
24
|
+
exercising permissions granted by this License.
|
|
25
|
+
|
|
26
|
+
"Source" form shall mean the preferred form for making modifications,
|
|
27
|
+
including but not limited to software source code, documentation
|
|
28
|
+
source, and configuration files.
|
|
29
|
+
|
|
30
|
+
"Object" form shall mean any form resulting from mechanical
|
|
31
|
+
transformation or translation of a Source form, including but
|
|
32
|
+
not limited to compiled object code, generated documentation,
|
|
33
|
+
and conversions to other media types.
|
|
34
|
+
|
|
35
|
+
"Work" shall mean the work of authorship, whether in Source or
|
|
36
|
+
Object form, made available under the License, as indicated by a
|
|
37
|
+
copyright notice that is included in or attached to the work
|
|
38
|
+
(an example is provided in the Appendix below).
|
|
39
|
+
|
|
40
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
|
41
|
+
form, that is based on (or derived from) the Work and for which the
|
|
42
|
+
editorial revisions, annotations, elaborations, or other modifications
|
|
43
|
+
represent, as a whole, an original work of authorship. For the purposes
|
|
44
|
+
of this License, Derivative Works shall not include works that remain
|
|
45
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
|
46
|
+
the Work and Derivative Works thereof.
|
|
47
|
+
|
|
48
|
+
"Contribution" shall mean any work of authorship, including
|
|
49
|
+
the original version of the Work and any modifications or additions
|
|
50
|
+
to that Work or Derivative Works thereof, that is intentionally
|
|
51
|
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
52
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
|
53
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
|
54
|
+
means any form of electronic, verbal, or written communication sent
|
|
55
|
+
to the Licensor or its representatives, including but not limited to
|
|
56
|
+
communication on electronic mailing lists, source code control systems,
|
|
57
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
|
58
|
+
Licensor for the purpose of discussing and improving the Work, but
|
|
59
|
+
excluding communication that is conspicuously marked or otherwise
|
|
60
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
|
61
|
+
|
|
62
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
63
|
+
on behalf of whom a Contribution has been received by Licensor and
|
|
64
|
+
subsequently incorporated within the Work.
|
|
65
|
+
|
|
66
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
67
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
68
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
69
|
+
copyright license to reproduce, prepare Derivative Works of,
|
|
70
|
+
publicly display, publicly perform, sublicense, and distribute the
|
|
71
|
+
Work and such Derivative Works in Source or Object form.
|
|
72
|
+
|
|
73
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
|
74
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
75
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
76
|
+
(except as stated in this section) patent license to make, have made,
|
|
77
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
78
|
+
where such license applies only to those patent claims licensable
|
|
79
|
+
by such Contributor that are necessarily infringed by their
|
|
80
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
|
81
|
+
with the Work to which such Contribution(s) was submitted. If You
|
|
82
|
+
institute patent litigation against any entity (including a
|
|
83
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
84
|
+
or a Contribution incorporated within the Work constitutes direct
|
|
85
|
+
or contributory patent infringement, then any patent licenses
|
|
86
|
+
granted to You under this License for that Work shall terminate
|
|
87
|
+
as of the date such litigation is filed.
|
|
88
|
+
|
|
89
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
|
90
|
+
Work or Derivative Works thereof in any medium, with or without
|
|
91
|
+
modifications, and in Source or Object form, provided that You
|
|
92
|
+
meet the following conditions:
|
|
93
|
+
|
|
94
|
+
(a) You must give any other recipients of the Work or
|
|
95
|
+
Derivative Works a copy of this License; and
|
|
96
|
+
|
|
97
|
+
(b) You must cause any modified files to carry prominent notices
|
|
98
|
+
stating that You changed the files; and
|
|
99
|
+
|
|
100
|
+
(c) You must retain, in the Source form of any Derivative Works
|
|
101
|
+
that You distribute, all copyright, patent, trademark, and
|
|
102
|
+
attribution notices from the Source form of the Work,
|
|
103
|
+
excluding those notices that do not pertain to any part of
|
|
104
|
+
the Derivative Works; and
|
|
105
|
+
|
|
106
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
|
107
|
+
distribution, then any Derivative Works that You distribute must
|
|
108
|
+
include a readable copy of the attribution notices contained
|
|
109
|
+
within such NOTICE file, excluding those notices that do not
|
|
110
|
+
pertain to any part of the Derivative Works, in at least one
|
|
111
|
+
of the following places: within a NOTICE text file distributed
|
|
112
|
+
as part of the Derivative Works; within the Source form or
|
|
113
|
+
documentation, if provided along with the Derivative Works; or,
|
|
114
|
+
within a display generated by the Derivative Works, if and
|
|
115
|
+
wherever such third-party notices normally appear. The contents
|
|
116
|
+
of the NOTICE file are for informational purposes only and
|
|
117
|
+
do not modify the License. You may add Your own attribution
|
|
118
|
+
notices within Derivative Works that You distribute, alongside
|
|
119
|
+
or as an addendum to the NOTICE text from the Work, provided
|
|
120
|
+
that such additional attribution notices cannot be construed
|
|
121
|
+
as modifying the License.
|
|
122
|
+
|
|
123
|
+
You may add Your own copyright statement to Your modifications and
|
|
124
|
+
may provide additional or different license terms and conditions
|
|
125
|
+
for use, reproduction, or distribution of Your modifications, or
|
|
126
|
+
for any such Derivative Works as a whole, provided Your use,
|
|
127
|
+
reproduction, and distribution of the Work otherwise complies with
|
|
128
|
+
the conditions stated in this License.
|
|
129
|
+
|
|
130
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
131
|
+
any Contribution intentionally submitted for inclusion in the Work
|
|
132
|
+
by You to the Licensor shall be under the terms and conditions of
|
|
133
|
+
this License, without any additional terms or conditions.
|
|
134
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
|
135
|
+
the terms of any separate license agreement you may have executed
|
|
136
|
+
with Licensor regarding such Contributions.
|
|
137
|
+
|
|
138
|
+
6. Trademarks. This License does not grant permission to use the trade
|
|
139
|
+
names, trademarks, service marks, or product names of the Licensor,
|
|
140
|
+
except as required for reasonable and customary use in describing the
|
|
141
|
+
origin of the Work and reproducing the content of the NOTICE file.
|
|
142
|
+
|
|
143
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
144
|
+
agreed to in writing, Licensor provides the Work (and each
|
|
145
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
146
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
147
|
+
implied, including, without limitation, any warranties or conditions
|
|
148
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
149
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
150
|
+
appropriateness of using or redistributing the Work and assume any
|
|
151
|
+
risks associated with Your exercise of permissions under this License.
|
|
152
|
+
|
|
153
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
|
154
|
+
whether in tort (including negligence), contract, or otherwise,
|
|
155
|
+
unless required by applicable law (such as deliberate and grossly
|
|
156
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
|
157
|
+
liable to You for damages, including any direct, indirect, special,
|
|
158
|
+
incidental, or consequential damages of any character arising as a
|
|
159
|
+
result of this License or out of the use or inability to use the
|
|
160
|
+
Work (including but not limited to damages for loss of goodwill,
|
|
161
|
+
work stoppage, computer failure or malfunction, or any and all
|
|
162
|
+
other commercial damages or losses), even if such Contributor
|
|
163
|
+
has been advised of the possibility of such damages.
|
|
164
|
+
|
|
165
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
|
166
|
+
the Work or Derivative Works thereof, You may choose to offer,
|
|
167
|
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
168
|
+
or other liability obligations and/or rights consistent with this
|
|
169
|
+
License. However, in accepting such obligations, You may act only
|
|
170
|
+
on Your own behalf and on Your sole responsibility, not on behalf
|
|
171
|
+
of any other Contributor, and only if You agree to indemnify,
|
|
172
|
+
defend, and hold each Contributor harmless for any liability
|
|
173
|
+
incurred by, or claims asserted against, such Contributor by reason
|
|
174
|
+
of your accepting any such warranty or additional liability.
|
|
175
|
+
|
|
176
|
+
END OF TERMS AND CONDITIONS
|
|
177
|
+
|
|
178
|
+
APPENDIX: How to apply the Apache License to your work.
|
|
179
|
+
|
|
180
|
+
To apply the Apache License to your work, attach the following
|
|
181
|
+
boilerplate notice, with the fields enclosed by brackets "[]"
|
|
182
|
+
replaced with your own identifying information. (Don't include
|
|
183
|
+
the brackets!) The text should be enclosed in the appropriate
|
|
184
|
+
comment syntax for the file format. We also recommend that a
|
|
185
|
+
file or class name and description of purpose be included on the
|
|
186
|
+
same "printed page" as the copyright notice for easier
|
|
187
|
+
identification within third-party archives.
|
|
188
|
+
|
|
189
|
+
Copyright [yyyy] [name of copyright owner]
|
|
190
|
+
|
|
191
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
192
|
+
you may not use this file except in compliance with the License.
|
|
193
|
+
You may obtain a copy of the License at
|
|
194
|
+
|
|
195
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
196
|
+
|
|
197
|
+
Unless required by applicable law or agreed to in writing, software
|
|
198
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
199
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
200
|
+
See the License for the specific language governing permissions and
|
|
201
|
+
limitations under the License.
|
package/README.md
CHANGED
|
@@ -1,13 +1,265 @@
|
|
|
1
1
|
# @tileflow/dev
|
|
2
2
|
|
|
3
|
-
Node utilities
|
|
3
|
+
Node.js utilities for custom Tileflow build tools and development servers. Load a trusted
|
|
4
|
+
`tileflow.config.ts`, prepare its assets, and produce a validated artifact generation.
|
|
5
|
+
|
|
6
|
+
Most applications should use the [CLI](https://github.com/tileflow/tileflow-sdk/blob/main/packages/cli/README.md)
|
|
7
|
+
or the [Vite](https://github.com/tileflow/tileflow-sdk/blob/main/packages/vite/README.md),
|
|
8
|
+
[Next.js](https://github.com/tileflow/tileflow-sdk/blob/main/packages/next/README.md), or
|
|
9
|
+
[Webpack](https://github.com/tileflow/tileflow-sdk/blob/main/packages/webpack/README.md) integration.
|
|
10
|
+
This package is for implementing an integration, not for browser rendering.
|
|
11
|
+
|
|
12
|
+
> Related packages and guides: [documentation index](https://raw.githubusercontent.com/tileflow/tileflow-sdk/main/llms.txt).
|
|
13
|
+
|
|
14
|
+
## Install
|
|
15
|
+
|
|
16
|
+
Use Node.js 22 or newer:
|
|
17
|
+
|
|
18
|
+
```sh
|
|
19
|
+
npm install --save-dev @tileflow/dev@alpha @tileflow/core@alpha @tileflow/maps@alpha
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
Create a trusted `tileflow.config.ts` in the working directory:
|
|
23
|
+
|
|
24
|
+
<!-- docs:check -->
|
|
4
25
|
|
|
5
26
|
```ts
|
|
6
|
-
import {
|
|
27
|
+
import {defineMap} from '@tileflow/core';
|
|
28
|
+
import {streets} from '@tileflow/maps';
|
|
7
29
|
|
|
8
|
-
|
|
9
|
-
|
|
30
|
+
export default defineMap({id: 'madrid', version: 1, extends: streets});
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
Loading the config executes its imports. It is not a sandbox for untrusted code. Local preparation
|
|
34
|
+
needs no API key, but serving a map can still cause requests to its remote data or font providers.
|
|
35
|
+
|
|
36
|
+
The CLI's local Inspector provides a dockable layer inspector, loaded tiles, assets, scene
|
|
37
|
+
controls and frame timing. Its element picker selects a layer and evaluates its rules using the
|
|
38
|
+
feature clicked on the map.
|
|
39
|
+
Debug's Overdraw overlay uses a heatmap with a visible pass-count legend and explanation.
|
|
40
|
+
|
|
41
|
+
## Prepare a generation
|
|
42
|
+
|
|
43
|
+
<!-- docs:check -->
|
|
44
|
+
|
|
45
|
+
```ts
|
|
46
|
+
import {createTileflowBuildArtifacts} from '@tileflow/dev/artifacts';
|
|
47
|
+
|
|
48
|
+
const artifacts = await createTileflowBuildArtifacts({config: 'tileflow.config.ts'});
|
|
49
|
+
|
|
50
|
+
try {
|
|
51
|
+
console.log(artifacts.manifest);
|
|
52
|
+
console.log(Object.keys(artifacts.styles.madrid));
|
|
53
|
+
} finally {
|
|
54
|
+
await artifacts.dispose?.();
|
|
55
|
+
}
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
The artifact plan exposes files and observed inputs from the same generation. Styles are keyed as
|
|
59
|
+
`styles[map][theme]`, never as an implicit default-theme alias. Keep that generation alive for the
|
|
60
|
+
whole operation, then release it. Do not reconstruct its asset list from directory guesses.
|
|
61
|
+
|
|
62
|
+
Map-owned tree models are prepared alongside icons and embedded in the styles. Custom tools that
|
|
63
|
+
compile icons separately can use `prepareTileflowMapTreeModels` from `@tileflow/dev/icons` with
|
|
64
|
+
the map's model directories, base directory, working directory, target and diagnostic path. Pass
|
|
65
|
+
its `models` result as `preparedAssets.models` when compiling the style; retain its source
|
|
66
|
+
identities and watch paths when managing revisions. The artifact pipeline does this automatically.
|
|
67
|
+
A GLB whose materials name only `bark`, `leaves`, `fronds` or `stem` is a tree model; any other
|
|
68
|
+
is a building model, whose materials name its parts.
|
|
69
|
+
|
|
70
|
+
To write production output rather than manage it in memory:
|
|
71
|
+
|
|
72
|
+
<!-- docs:check -->
|
|
73
|
+
|
|
74
|
+
```ts
|
|
75
|
+
import {writeTileflowBuildArtifacts} from '@tileflow/dev/artifacts';
|
|
76
|
+
|
|
77
|
+
await writeTileflowBuildArtifacts({
|
|
78
|
+
config: 'tileflow.config.ts',
|
|
79
|
+
outDir: 'public/tileflow',
|
|
10
80
|
});
|
|
11
81
|
```
|
|
12
82
|
|
|
13
|
-
|
|
83
|
+
Serve the complete output. The writer installs immutable generation assets before changing the
|
|
84
|
+
manifest pointer, tracks its own files, and refuses to replace a hosted manifest by default.
|
|
85
|
+
Native builds retain embedded PNG image sources as hashed files beside the styles, so their
|
|
86
|
+
resource URLs remain portable without permitting data URLs in the native profile.
|
|
87
|
+
`overwriteHostedManifest: true` is an explicit migration option, not a normal build setting.
|
|
88
|
+
Production rejects unresolved local PMTiles; publish data explicitly or provide an application-owned
|
|
89
|
+
production source. Local development snapshots do not publish or redistribute the original dataset.
|
|
90
|
+
|
|
91
|
+
Maps whose labels use a line-fitted `text.background` draw text with derived glyph stacks. Local
|
|
92
|
+
previews and captures route such a map's glyph URL through `__glyphs/<map>/…`. Ordinary stacks pass
|
|
93
|
+
through from the declared provider; derived ranges are computed from their source ranges, which are
|
|
94
|
+
cached under `.tileflow/cache/glyphs/v1`. Production output keeps the declared provider, which must
|
|
95
|
+
serve derived stacks.
|
|
96
|
+
|
|
97
|
+
## Keep a watched request handler
|
|
98
|
+
|
|
99
|
+
Use one session for repeated work and close it when the owning server stops:
|
|
100
|
+
|
|
101
|
+
<!-- docs:check -->
|
|
102
|
+
|
|
103
|
+
```ts
|
|
104
|
+
import {createTileflowArtifactSession} from '@tileflow/dev/artifacts';
|
|
105
|
+
import {createTileflowDevRequestHandler} from '@tileflow/dev/server';
|
|
106
|
+
|
|
107
|
+
export async function createMapHandler() {
|
|
108
|
+
const session = await createTileflowArtifactSession({
|
|
109
|
+
config: 'tileflow.config.ts',
|
|
110
|
+
watch: true,
|
|
111
|
+
});
|
|
112
|
+
const handler = createTileflowDevRequestHandler({session});
|
|
113
|
+
|
|
114
|
+
return {
|
|
115
|
+
fetch: handler,
|
|
116
|
+
async close() {
|
|
117
|
+
await handler.close();
|
|
118
|
+
await session.close();
|
|
119
|
+
},
|
|
120
|
+
};
|
|
121
|
+
}
|
|
122
|
+
```
|
|
123
|
+
|
|
124
|
+
The caller mounts `fetch` in its server and calls `close()` on shutdown. This factory does not open
|
|
125
|
+
a listener. Sessions follow config imports and local asset inputs, retain the last good generation
|
|
126
|
+
after invalid edits, and publish structured state changes through `subscribe()`.
|
|
127
|
+
Session creation waits for the first valid generation or a settled invalid result, including
|
|
128
|
+
when a watched edit replaces the initial build before it finishes.
|
|
129
|
+
Watching follows aliased working directories, including newly created or removed icon metadata.
|
|
130
|
+
Package assets resolve from the config directory. Linked package assets inside the selected working
|
|
131
|
+
tree are watched too; installed assets in `node_modules` remain immutable.
|
|
132
|
+
|
|
133
|
+
A single startup consistency check complements ordinary watcher notifications; no recurring scan
|
|
134
|
+
is added.
|
|
135
|
+
|
|
136
|
+
`getState()` and `getLastGoodArtifacts()` return borrowed synchronous views. Before asynchronous
|
|
137
|
+
work, call `acquireArtifacts(generation?)` and release the acquisition in `finally`. A replaced
|
|
138
|
+
generation accepts no new acquisitions; closing a session waits for existing acquisitions.
|
|
139
|
+
|
|
140
|
+
## Choose an entry point
|
|
141
|
+
|
|
142
|
+
Use `/artifacts` for preparation and output, `/server` for HTTP handling, `/config` for trusted config
|
|
143
|
+
loading, `/icons` and `/fonts` for asset preparation, `/inspect` for bounded inspection, `/tilesets`
|
|
144
|
+
for local PMTiles inspection, and `/validation` for diagnostics. `/preview` is the local preview
|
|
145
|
+
contract, including experimental preview-only rendering; it does not promise hosted support.
|
|
146
|
+
The package has no root entry point. `/server` also exposes the reusable Inspector shell. The CLI
|
|
147
|
+
connects appearance controls and shared browser context through its optional local
|
|
148
|
+
workflow adapter.
|
|
149
|
+
The navigation contains **Map**, **Layers**, **Tiles**, **Assets**, **Debug** and **Diagnostics**.
|
|
150
|
+
Zoom, Pitch and Bearing appear as **Z**, **P** and **B** directly below it, with live Zoom and Pitch
|
|
151
|
+
sliders and **Copy for AI**. Pitch and Bearing each have an inline reset to 0° within the map's
|
|
152
|
+
camera limits. Camera resets preserve the current zoom and map position.
|
|
153
|
+
The active tab and selected layer remain in the URL across reloads. The menu provides left,
|
|
154
|
+
right and bottom docking, System/Light/Dark appearance, and **Reset all changes**.
|
|
155
|
+
Side docking has a minimum width of 640 CSS pixels, including restored layouts.
|
|
156
|
+
|
|
157
|
+
**Map** exposes time-of-day segments, theme cards with actual style swatches, 3D view,
|
|
158
|
+
Off/Grow/Fade building animation, and the map's module settings. The command selects the map.
|
|
159
|
+
Streets shows **Default**, **Faded** and **Monochrome**; Default keeps the compatible `light`
|
|
160
|
+
theme ID in configs, URLs and capture commands. Time of day is selected independently.
|
|
161
|
+
3D view defaults to on for every map. Buildings fade in between zoom 15 and 15.25.
|
|
162
|
+
Toggling 3D view preserves the camera, including pitch; an explicit off setting stays off.
|
|
163
|
+
Changes update the existing map after a 300 ms pause while the form remains editable. Superseded
|
|
164
|
+
compilations are discarded. Runtime controls do not recompile the style. Scene and layer edits
|
|
165
|
+
share the header Undo/Redo controls; source files stay unchanged.
|
|
166
|
+
|
|
167
|
+
**Layers** groups physical and runtime layers by module or draw order. Hover highlights geometry;
|
|
168
|
+
selection keeps it highlighted independently of the element picker. The picker opens the clicked
|
|
169
|
+
feature's layer in **Rules**. Rules expose live colors, numeric sliders, enums, expression curves,
|
|
170
|
+
defaults, and checkboxes for temporarily disabling paint, layout and filters. Diagnosis, Data and
|
|
171
|
+
Origin explain renderer state, sample features and available compiler provenance. **Visible**
|
|
172
|
+
filters to the current viewport. Context can be reviewed as Markdown or JSON before copying.
|
|
173
|
+
|
|
174
|
+
**Tiles** shows resident map tiles as a coordinate grid and source-grouped list. Source layers,
|
|
175
|
+
Features and Info expose raw payload sizes, consumer layers, paginated features, GeoJSON and bounds.
|
|
176
|
+
Inspection reads resident data without issuing tile requests. MLT and inaccessible renderer data
|
|
177
|
+
have explicit unavailable states.
|
|
178
|
+
|
|
179
|
+
**Assets** separates Icons, 3D models and Fonts. Icons lists real registered images and loads actual
|
|
180
|
+
sprite variants for the map's themes and times of day. Models previews bounded samples of loaded
|
|
181
|
+
controller meshes, with available counts, bytes and LODs. Fonts renders editable samples from actual
|
|
182
|
+
font files or glyphs and links back to consuming layers.
|
|
183
|
+
|
|
184
|
+
**Debug** contains overdraw, collision and tile-boundary overlays, explanations, and controls for
|
|
185
|
+
the map's actual pixel ratio. **Diagnostics** lists actionable findings under Readability, Style,
|
|
186
|
+
Assets and Performance. Problems identify confirmed failures; Review findings describe situations
|
|
187
|
+
that can be intentional. There are no quality scores or automatic camera tours. Style checks refresh
|
|
188
|
+
when the map changes; **Check view** collects bounded current-view evidence and briefly samples
|
|
189
|
+
drawing work. Findings open the affected layer and rule, show available evidence, and copy context
|
|
190
|
+
for an agent. Unavailable observations and stale results remain explicit. **Diagnosis** in
|
|
191
|
+
Layers describes the selected layer's zoom, visibility and feature-rule context without turning
|
|
192
|
+
empty viewport queries into errors. Legacy `tab=beacon` links open Diagnostics.
|
|
193
|
+
|
|
194
|
+
The preview's globe rim follows the rendered canvas silhouette, including camera and viewport
|
|
195
|
+
changes, and fades between zooms 3 and 6. Its colors follow the map's atmosphere when declared.
|
|
196
|
+
|
|
197
|
+
Invalid compiled styles throw `TileflowStyleValidationError` with bounded issues. Keep diagnostics
|
|
198
|
+
structured; do not return executable config, local paths, credentials, or complete generated byte
|
|
199
|
+
arrays from a public endpoint.
|
|
200
|
+
|
|
201
|
+
## Locked Icon Set composition
|
|
202
|
+
|
|
203
|
+
`composeTileflowIconSources(sources, {cwd, lock, cacheRoot, offline: true})` combines local/package
|
|
204
|
+
directories and `iconSet('@team/set')` contributors into one effective sprite. Without an explicit
|
|
205
|
+
lock object, it reads `tileflow.icons.lock.json` beside `baseDirectory` (default: `cwd`). It never
|
|
206
|
+
resolves latest or writes the lock. The result contains the generated `package`, ordered
|
|
207
|
+
`composition` receipt, effective `sourceIdentities`, declared `contributors`, effective `winners`,
|
|
208
|
+
replacement ordinals, local `watchPaths`, and the exact `watchFiles` that select the composition.
|
|
209
|
+
Pass both the source identities and receipt to Core map-revision hashing.
|
|
210
|
+
|
|
211
|
+
This is the one normal icon-preparation path. `compileTileflowIconPackages`,
|
|
212
|
+
`prepareTileflowCatalogIcons`, `inspectTileflowIconCatalogs` and `getTileflowIconWatchPaths` all use
|
|
213
|
+
it, so `createTileflowBuildArtifacts`, `createTileflowArtifactSession`, and every adapter that
|
|
214
|
+
enters them accept the same explicit `icons` resolution options: `cacheRoot`, `offline`,
|
|
215
|
+
`deliveryOrigins`, `fetch` and `signal`. An explicit `cacheRoot` takes precedence over
|
|
216
|
+
`TILEFLOW_ICON_CACHE_DIR`, then the OS cache default. Origins and transport use their documented
|
|
217
|
+
defaults unless supplied explicitly; no build or watch polls a catalog head. `prepareTileflowCatalogIcons`
|
|
218
|
+
returns `mapIconCompositions` alongside `mapIconSources`, and build-manifest entries carry the
|
|
219
|
+
receipt as `sourceAssets.iconComposition` with `mapRevisionSchemaVersion: 2`.
|
|
220
|
+
|
|
221
|
+
A map whose contributors are all local or package directories keeps its existing generated bytes,
|
|
222
|
+
manifest and content hash, and its build-manifest entry stays on the legacy v1 contract.
|
|
223
|
+
|
|
224
|
+
The reader verifies each file length/checksum, PNG/index geometry, names, density pairing, and both
|
|
225
|
+
per-icon pixel hashes. It copies decoded 1x and 2x cells independently, without resampling either.
|
|
226
|
+
The existing directory compiler and this port share the same sprite packer. A sole shared set reuses
|
|
227
|
+
its exact artifact; mixed inputs are packed deterministically. Later contributors win and all
|
|
228
|
+
dependencies remain in the receipt, even when entirely shadowed. Shared inputs never pretend to
|
|
229
|
+
contain original SVG/source identities. Existing local-only compilation remains unchanged.
|
|
230
|
+
|
|
231
|
+
`storeTileflowIconSetArtifact` seeds an exact verified cache entry. `loadTileflowIconSetArtifact`
|
|
232
|
+
uses the cache or hydrates only the selected artifact's four public files. Hydration defaults to the
|
|
233
|
+
trusted `https://api.tileflow.dev` origin, sends no credentials, and follows no redirects.
|
|
234
|
+
Applications may explicitly configure trusted `deliveryOrigins`; locks cannot add them. `offline`
|
|
235
|
+
forbids all fetches and fails on missing or corrupt entries. Complete-map offline rendering still
|
|
236
|
+
depends on unrelated tiles, glyphs, and other external resources.
|
|
237
|
+
|
|
238
|
+
The cache lives under the OS user cache with `tileflow/icons/v1/<contentHash>`. `cacheRoot`, then
|
|
239
|
+
`TILEFLOW_ICON_CACHE_DIR`, overrides its parent. Atomic directory installation and exact-entry
|
|
240
|
+
retirement support concurrent writers and corruption repair. Symlink entries are rejected. This is
|
|
241
|
+
a disposable cache, not a security sandbox against another process controlling the same user
|
|
242
|
+
account. Incomplete temporary entries are never accepted as published cache entries.
|
|
243
|
+
|
|
244
|
+
`readTileflowIconsLockfileText(directory)` returns the exact current lock bytes, or `null` when no
|
|
245
|
+
lock exists; those bytes are the only valid `expectedContents` for the next write.
|
|
246
|
+
`writeTileflowIconsLockfile(directory, lock, expectedContents)` uses a whole-file compare-and-swap
|
|
247
|
+
and atomic rename. A conflicting writer fails without overwriting pins. An interrupted writer leaves
|
|
248
|
+
the previous complete lock intact; remove a stale `.writing` guard only after confirming that its
|
|
249
|
+
writer has exited. Ordinary reads and Core validation never acquire write guards.
|
|
250
|
+
|
|
251
|
+
A package supports up to 1,000 effective icons, subject to a 2,048-pixel atlas dimension,
|
|
252
|
+
4 MiB per generated file, and 8 MiB per package. Paired densities share a logical layout capped
|
|
253
|
+
at 1,024 pixels per dimension at 1× and 2,048 at 2×. Mixed-size artwork retains matching placements
|
|
254
|
+
without resampling either density. Larger artwork can hit those limits before
|
|
255
|
+
1,000 icons. Several individually valid sets can exceed the effective map limit; composition
|
|
256
|
+
fails explicitly instead of clipping. Cache and composition do not create Team resources or
|
|
257
|
+
publish anything. Every normal entry point composes declared shared descriptors through this path;
|
|
258
|
+
catalog publication and lock maintenance stay in the `tileflow` CLI, which is the only writer of
|
|
259
|
+
`tileflow.icons.lock.json` and the only caller that resolves `latest`.
|
|
260
|
+
|
|
261
|
+
## Recolorable icons
|
|
262
|
+
|
|
263
|
+
Declare SDF defaults and optional stretch/content layout in `tileflow.icons.json` beside ordinary artwork. Preparation
|
|
264
|
+
verifies both densities and rejects mixed representations within one symbol layer, including
|
|
265
|
+
fallbacks and local overrides.
|