@tileflow/vite 0.1.0-alpha.22 → 0.1.0-alpha.24
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 +8 -5
- package/dist/index.d.ts +8 -0
- package/dist/index.js +4 -1
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -48,9 +48,9 @@ export default defineConfig({plugins: [tileflow()]});
|
|
|
48
48
|
```
|
|
49
49
|
|
|
50
50
|
Run the application's normal development or production-build command. At the default base, the
|
|
51
|
-
component can use `source={{
|
|
52
|
-
|
|
53
|
-
Config loading executes trusted imports and is not a sandbox.
|
|
51
|
+
component can use `source={{map: 'madrid'}}`; it reads `/tileflow/manifest.json`. The source selects
|
|
52
|
+
a Tileflow map, not a renderer or direct style. Do not also run a CLI build that overwrites the same
|
|
53
|
+
delivery manifest. Config loading executes trusted imports and is not a sandbox.
|
|
54
54
|
|
|
55
55
|
## Configure the worker
|
|
56
56
|
|
|
@@ -86,12 +86,15 @@ export default defineConfig({
|
|
|
86
86
|
|
|
87
87
|
In the application, pass the resulting public URL explicitly:
|
|
88
88
|
|
|
89
|
+
<!-- docs:check -->
|
|
90
|
+
|
|
89
91
|
```ts
|
|
92
|
+
import type {TileflowRuntimeSource} from '@tileflow/core/runtime';
|
|
93
|
+
|
|
90
94
|
const source = {
|
|
91
|
-
kind: 'tileflow' as const,
|
|
92
95
|
map: 'madrid',
|
|
93
96
|
manifestUrl: '/app/maps/manifest.json',
|
|
94
|
-
};
|
|
97
|
+
} satisfies TileflowRuntimeSource;
|
|
95
98
|
```
|
|
96
99
|
|
|
97
100
|
Development and production expose the same prefixed URL. The browser does not infer Vite's base;
|
package/dist/index.d.ts
CHANGED
|
@@ -1,10 +1,18 @@
|
|
|
1
1
|
import { Plugin } from 'vite';
|
|
2
|
+
import { TileflowIconResolutionOptions } from '@tileflow/dev/artifacts';
|
|
2
3
|
|
|
3
4
|
type TileflowVitePluginOptions = {
|
|
4
5
|
apiBaseUrl?: string;
|
|
5
6
|
base?: string;
|
|
6
7
|
config?: string;
|
|
7
8
|
emitBuildArtifacts?: boolean;
|
|
9
|
+
/**
|
|
10
|
+
* Explicit shared Icon Set resolution settings.
|
|
11
|
+
*
|
|
12
|
+
* These choose the verified cache root, offline behavior, trusted delivery origins and the
|
|
13
|
+
* transport used to hydrate exact locked pins. No build resolves a catalog head.
|
|
14
|
+
*/
|
|
15
|
+
icons?: TileflowIconResolutionOptions;
|
|
8
16
|
overwriteHostedManifest?: boolean;
|
|
9
17
|
};
|
|
10
18
|
declare function tileflow(options?: TileflowVitePluginOptions): Plugin;
|
package/dist/index.js
CHANGED
|
@@ -9,6 +9,7 @@ import {
|
|
|
9
9
|
disposeTileflowBuildArtifacts,
|
|
10
10
|
getTileflowAssetBasePath,
|
|
11
11
|
getTileflowAssetFileName,
|
|
12
|
+
getTileflowWatchPaths,
|
|
12
13
|
normalizeTileflowBasePath,
|
|
13
14
|
refreshTileflowArtifactSession,
|
|
14
15
|
resolveTileflowArtifactPublicUrls
|
|
@@ -38,6 +39,7 @@ function tileflow(options = {}) {
|
|
|
38
39
|
assetBaseUrl: artifactBasePath,
|
|
39
40
|
config: configPath,
|
|
40
41
|
cwd: root,
|
|
42
|
+
...options.icons ? { icons: options.icons } : {},
|
|
41
43
|
styleBaseUrl: artifactBasePath,
|
|
42
44
|
apiBaseUrl: options.apiBaseUrl,
|
|
43
45
|
watch: false
|
|
@@ -68,7 +70,7 @@ function tileflow(options = {}) {
|
|
|
68
70
|
const refreshWatchedInputPaths = async () => {
|
|
69
71
|
try {
|
|
70
72
|
const session = await sessionPromise;
|
|
71
|
-
const watchPaths = session.getLastGoodArtifacts()?.watchPaths ??
|
|
73
|
+
const watchPaths = session.getLastGoodArtifacts()?.watchPaths ?? await getTileflowWatchPaths({ config: configPath, cwd: root });
|
|
72
74
|
const nextWatchPaths = new Set(watchPaths);
|
|
73
75
|
const staleWatchPaths = [...watchedInputPaths].filter(
|
|
74
76
|
(watchPath) => !nextWatchPaths.has(watchPath)
|
|
@@ -139,6 +141,7 @@ function tileflow(options = {}) {
|
|
|
139
141
|
assetBaseUrl: publicUrls.assetBaseUrl,
|
|
140
142
|
config: configPath,
|
|
141
143
|
cwd: config.root,
|
|
144
|
+
...options.icons ? { icons: options.icons } : {},
|
|
142
145
|
styleBaseUrl: publicUrls.styleBaseUrl,
|
|
143
146
|
apiBaseUrl: options.apiBaseUrl,
|
|
144
147
|
target: "production"
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tileflow/vite",
|
|
3
|
-
"version": "0.1.0-alpha.
|
|
3
|
+
"version": "0.1.0-alpha.24",
|
|
4
4
|
"license": "Apache-2.0",
|
|
5
5
|
"description": "Vite plugin for Tileflow map style development and static artifacts.",
|
|
6
6
|
"engines": {
|
|
@@ -41,14 +41,14 @@
|
|
|
41
41
|
"access": "public"
|
|
42
42
|
},
|
|
43
43
|
"dependencies": {
|
|
44
|
-
"@tileflow/dev": ">=0.1.0-alpha.
|
|
44
|
+
"@tileflow/dev": ">=0.1.0-alpha.26 <0.1.0-beta.0"
|
|
45
45
|
},
|
|
46
46
|
"peerDependencies": {
|
|
47
47
|
"vite": ">=5 <9"
|
|
48
48
|
},
|
|
49
49
|
"devDependencies": {
|
|
50
50
|
"vite": "^8.0.16",
|
|
51
|
-
"@tileflow/maps": "0.1.0-alpha.
|
|
51
|
+
"@tileflow/maps": "0.1.0-alpha.5"
|
|
52
52
|
},
|
|
53
53
|
"scripts": {
|
|
54
54
|
"build": "tsup src/index.ts --format esm --dts --clean --external vite --platform node",
|