diff --git a/.gitignore b/.gitignore index 6c10f32a..6e95b583 100644 --- a/.gitignore +++ b/.gitignore @@ -65,6 +65,7 @@ lib/data/spatial/forest_types_ne lib/data/spatial/forest_types_sg lib/data/spatial/forest_types_sh lib/data/spatial/forest_types_so +lib/data/spatial/forest_types_sz lib/data/spatial/forest_types_tg lib/data/spatial/forest_types_vd lib/data/spatial/forest_types_zh diff --git a/lib/data/spatial/3-tile.sh b/lib/data/spatial/3-tile.sh index f7f083af..44d0b0fe 100755 --- a/lib/data/spatial/3-tile.sh +++ b/lib/data/spatial/3-tile.sh @@ -13,7 +13,7 @@ _tile "forest_types" _tile "silver_fir_areas" echo "Joining tiles ..." -cd /data/spatial/tiles +cd /data/spatial/tree-app-tiles/tiles tile-join --force --maximum-zoom=12 --no-tile-size-limit -e "tree" altitudinal_zones_1995.mbtiles altitudinal_zones_2085_dry.mbtiles altitudinal_zones_2085_less_dry.mbtiles cantonal_boundaries.mbtiles forest_ecoregions.mbtiles forest_types.mbtiles silver_fir_areas.mbtiles rm altitudinal_zones_1995.mbtiles altitudinal_zones_2085_dry.mbtiles altitudinal_zones_2085_less_dry.mbtiles cantonal_boundaries.mbtiles forest_ecoregions.mbtiles forest_types.mbtiles silver_fir_areas.mbtiles find tree -name '*.pbf' > tiles.txt \ No newline at end of file diff --git a/lib/data/spatial/4-fonts.sh b/lib/data/spatial/4-fonts.sh index 20021931..d4216f12 100755 --- a/lib/data/spatial/4-fonts.sh +++ b/lib/data/spatial/4-fonts.sh @@ -1,4 +1,4 @@ yarn run generate-mapbox-gl-fonts mkdir -p data/spatial/tiles/fonts -cp -r _output/Roboto\ Regular data/spatial/tiles/fonts/Roboto\ Regular +cp -r _output/Roboto\ Regular data/spatial/tree-app-tiles/tiles/fonts/Roboto\ Regular rm -r _output \ No newline at end of file diff --git a/lib/data/spatial/tiles/.gitignore b/lib/data/spatial/tiles/.gitignore deleted file mode 100644 index e985853e..00000000 --- a/lib/data/spatial/tiles/.gitignore +++ /dev/null @@ -1 +0,0 @@ -.vercel diff --git a/lib/data/spatial/tiles/vercel.json b/lib/data/spatial/tiles/vercel.json deleted file mode 100755 index ee17b6d2..00000000 --- a/lib/data/spatial/tiles/vercel.json +++ /dev/null @@ -1,49 +0,0 @@ -{ - "headers": [ - { - "source": "/(.*).json", - "headers": [ - { - "key": "Access-Control-Allow-Origin", - "value": "*" - } - ] - }, - { - "source": "/(.*).pbf", - "headers": [ - { - "key": "Access-Control-Allow-Origin", - "value": "*" - } - ] - }, - { - "source": "/(.*).pdf", - "headers": [ - { - "key": "Content-Disposition", - "value": "inline" - } - ] - }, - { - "source": "/(.*).txt", - "headers": [ - { - "key": "Access-Control-Allow-Origin", - "value": "*" - } - ] - }, - { - "source": "/tree/(.*).pbf", - "headers": [ - { - "key": "Content-Encoding", - "value": "gzip" - } - ] - } - ] -} diff --git a/lib/data/spatial/tree-app-tiles/.gitignore b/lib/data/spatial/tree-app-tiles/.gitignore new file mode 100644 index 00000000..08df6912 --- /dev/null +++ b/lib/data/spatial/tree-app-tiles/.gitignore @@ -0,0 +1,4 @@ +.vercel +node_modules +tiles/* +dist \ No newline at end of file diff --git a/lib/data/spatial/tree-app-tiles/package.json b/lib/data/spatial/tree-app-tiles/package.json new file mode 100644 index 00000000..1ac6384c --- /dev/null +++ b/lib/data/spatial/tree-app-tiles/package.json @@ -0,0 +1,19 @@ +{ + "name": "hono-tile-server", + "version": "1.0.0", + "type": "module", + "scripts": { + "dev": "tsx watch server.ts", + "start": "node dist/server.js", + "build": "tsc" + }, + "dependencies": { + "@hono/node-server": "^1.11.0", + "hono": "^4.6.0" + }, + "devDependencies": { + "@types/node": "^24.3.0", + "tsx": "^4.15.0", + "typescript": "^5.6.3" + } +} \ No newline at end of file diff --git a/lib/data/spatial/tree-app-tiles/pnpm-lock.yaml b/lib/data/spatial/tree-app-tiles/pnpm-lock.yaml new file mode 100644 index 00000000..b89d878c --- /dev/null +++ b/lib/data/spatial/tree-app-tiles/pnpm-lock.yaml @@ -0,0 +1,365 @@ +lockfileVersion: '9.0' + +settings: + autoInstallPeers: true + excludeLinksFromLockfile: false + +importers: + + .: + dependencies: + '@hono/node-server': + specifier: ^1.11.0 + version: 1.19.0(hono@4.9.4) + hono: + specifier: ^4.6.0 + version: 4.9.4 + devDependencies: + '@types/node': + specifier: ^24.3.0 + version: 24.3.0 + tsx: + specifier: ^4.15.0 + version: 4.20.5 + typescript: + specifier: ^5.6.3 + version: 5.9.2 + +packages: + + '@esbuild/aix-ppc64@0.25.9': + resolution: {integrity: sha512-OaGtL73Jck6pBKjNIe24BnFE6agGl+6KxDtTfHhy1HmhthfKouEcOhqpSL64K4/0WCtbKFLOdzD/44cJ4k9opA==} + engines: {node: '>=18'} + cpu: [ppc64] + os: [aix] + + '@esbuild/android-arm64@0.25.9': + resolution: {integrity: sha512-IDrddSmpSv51ftWslJMvl3Q2ZT98fUSL2/rlUXuVqRXHCs5EUF1/f+jbjF5+NG9UffUDMCiTyh8iec7u8RlTLg==} + engines: {node: '>=18'} + cpu: [arm64] + os: [android] + + '@esbuild/android-arm@0.25.9': + resolution: {integrity: sha512-5WNI1DaMtxQ7t7B6xa572XMXpHAaI/9Hnhk8lcxF4zVN4xstUgTlvuGDorBguKEnZO70qwEcLpfifMLoxiPqHQ==} + engines: {node: '>=18'} + cpu: [arm] + os: [android] + + '@esbuild/android-x64@0.25.9': + resolution: {integrity: sha512-I853iMZ1hWZdNllhVZKm34f4wErd4lMyeV7BLzEExGEIZYsOzqDWDf+y082izYUE8gtJnYHdeDpN/6tUdwvfiw==} + engines: {node: '>=18'} + cpu: [x64] + os: [android] + + '@esbuild/darwin-arm64@0.25.9': + resolution: {integrity: sha512-XIpIDMAjOELi/9PB30vEbVMs3GV1v2zkkPnuyRRURbhqjyzIINwj+nbQATh4H9GxUgH1kFsEyQMxwiLFKUS6Rg==} + engines: {node: '>=18'} + cpu: [arm64] + os: [darwin] + + '@esbuild/darwin-x64@0.25.9': + resolution: {integrity: sha512-jhHfBzjYTA1IQu8VyrjCX4ApJDnH+ez+IYVEoJHeqJm9VhG9Dh2BYaJritkYK3vMaXrf7Ogr/0MQ8/MeIefsPQ==} + engines: {node: '>=18'} + cpu: [x64] + os: [darwin] + + '@esbuild/freebsd-arm64@0.25.9': + resolution: {integrity: sha512-z93DmbnY6fX9+KdD4Ue/H6sYs+bhFQJNCPZsi4XWJoYblUqT06MQUdBCpcSfuiN72AbqeBFu5LVQTjfXDE2A6Q==} + engines: {node: '>=18'} + cpu: [arm64] + os: [freebsd] + + '@esbuild/freebsd-x64@0.25.9': + resolution: {integrity: sha512-mrKX6H/vOyo5v71YfXWJxLVxgy1kyt1MQaD8wZJgJfG4gq4DpQGpgTB74e5yBeQdyMTbgxp0YtNj7NuHN0PoZg==} + engines: {node: '>=18'} + cpu: [x64] + os: [freebsd] + + '@esbuild/linux-arm64@0.25.9': + resolution: {integrity: sha512-BlB7bIcLT3G26urh5Dmse7fiLmLXnRlopw4s8DalgZ8ef79Jj4aUcYbk90g8iCa2467HX8SAIidbL7gsqXHdRw==} + engines: {node: '>=18'} + cpu: [arm64] + os: [linux] + + '@esbuild/linux-arm@0.25.9': + resolution: {integrity: sha512-HBU2Xv78SMgaydBmdor38lg8YDnFKSARg1Q6AT0/y2ezUAKiZvc211RDFHlEZRFNRVhcMamiToo7bDx3VEOYQw==} + engines: {node: '>=18'} + cpu: [arm] + os: [linux] + + '@esbuild/linux-ia32@0.25.9': + resolution: {integrity: sha512-e7S3MOJPZGp2QW6AK6+Ly81rC7oOSerQ+P8L0ta4FhVi+/j/v2yZzx5CqqDaWjtPFfYz21Vi1S0auHrap3Ma3A==} + engines: {node: '>=18'} + cpu: [ia32] + os: [linux] + + '@esbuild/linux-loong64@0.25.9': + resolution: {integrity: sha512-Sbe10Bnn0oUAB2AalYztvGcK+o6YFFA/9829PhOCUS9vkJElXGdphz0A3DbMdP8gmKkqPmPcMJmJOrI3VYB1JQ==} + engines: {node: '>=18'} + cpu: [loong64] + os: [linux] + + '@esbuild/linux-mips64el@0.25.9': + resolution: {integrity: sha512-YcM5br0mVyZw2jcQeLIkhWtKPeVfAerES5PvOzaDxVtIyZ2NUBZKNLjC5z3/fUlDgT6w89VsxP2qzNipOaaDyA==} + engines: {node: '>=18'} + cpu: [mips64el] + os: [linux] + + '@esbuild/linux-ppc64@0.25.9': + resolution: {integrity: sha512-++0HQvasdo20JytyDpFvQtNrEsAgNG2CY1CLMwGXfFTKGBGQT3bOeLSYE2l1fYdvML5KUuwn9Z8L1EWe2tzs1w==} + engines: {node: '>=18'} + cpu: [ppc64] + os: [linux] + + '@esbuild/linux-riscv64@0.25.9': + resolution: {integrity: sha512-uNIBa279Y3fkjV+2cUjx36xkx7eSjb8IvnL01eXUKXez/CBHNRw5ekCGMPM0BcmqBxBcdgUWuUXmVWwm4CH9kg==} + engines: {node: '>=18'} + cpu: [riscv64] + os: [linux] + + '@esbuild/linux-s390x@0.25.9': + resolution: {integrity: sha512-Mfiphvp3MjC/lctb+7D287Xw1DGzqJPb/J2aHHcHxflUo+8tmN/6d4k6I2yFR7BVo5/g7x2Monq4+Yew0EHRIA==} + engines: {node: '>=18'} + cpu: [s390x] + os: [linux] + + '@esbuild/linux-x64@0.25.9': + resolution: {integrity: sha512-iSwByxzRe48YVkmpbgoxVzn76BXjlYFXC7NvLYq+b+kDjyyk30J0JY47DIn8z1MO3K0oSl9fZoRmZPQI4Hklzg==} + engines: {node: '>=18'} + cpu: [x64] + os: [linux] + + '@esbuild/netbsd-arm64@0.25.9': + resolution: {integrity: sha512-9jNJl6FqaUG+COdQMjSCGW4QiMHH88xWbvZ+kRVblZsWrkXlABuGdFJ1E9L7HK+T0Yqd4akKNa/lO0+jDxQD4Q==} + engines: {node: '>=18'} + cpu: [arm64] + os: [netbsd] + + '@esbuild/netbsd-x64@0.25.9': + resolution: {integrity: sha512-RLLdkflmqRG8KanPGOU7Rpg829ZHu8nFy5Pqdi9U01VYtG9Y0zOG6Vr2z4/S+/3zIyOxiK6cCeYNWOFR9QP87g==} + engines: {node: '>=18'} + cpu: [x64] + os: [netbsd] + + '@esbuild/openbsd-arm64@0.25.9': + resolution: {integrity: sha512-YaFBlPGeDasft5IIM+CQAhJAqS3St3nJzDEgsgFixcfZeyGPCd6eJBWzke5piZuZ7CtL656eOSYKk4Ls2C0FRQ==} + engines: {node: '>=18'} + cpu: [arm64] + os: [openbsd] + + '@esbuild/openbsd-x64@0.25.9': + resolution: {integrity: sha512-1MkgTCuvMGWuqVtAvkpkXFmtL8XhWy+j4jaSO2wxfJtilVCi0ZE37b8uOdMItIHz4I6z1bWWtEX4CJwcKYLcuA==} + engines: {node: '>=18'} + cpu: [x64] + os: [openbsd] + + '@esbuild/openharmony-arm64@0.25.9': + resolution: {integrity: sha512-4Xd0xNiMVXKh6Fa7HEJQbrpP3m3DDn43jKxMjxLLRjWnRsfxjORYJlXPO4JNcXtOyfajXorRKY9NkOpTHptErg==} + engines: {node: '>=18'} + cpu: [arm64] + os: [openharmony] + + '@esbuild/sunos-x64@0.25.9': + resolution: {integrity: sha512-WjH4s6hzo00nNezhp3wFIAfmGZ8U7KtrJNlFMRKxiI9mxEK1scOMAaa9i4crUtu+tBr+0IN6JCuAcSBJZfnphw==} + engines: {node: '>=18'} + cpu: [x64] + os: [sunos] + + '@esbuild/win32-arm64@0.25.9': + resolution: {integrity: sha512-mGFrVJHmZiRqmP8xFOc6b84/7xa5y5YvR1x8djzXpJBSv/UsNK6aqec+6JDjConTgvvQefdGhFDAs2DLAds6gQ==} + engines: {node: '>=18'} + cpu: [arm64] + os: [win32] + + '@esbuild/win32-ia32@0.25.9': + resolution: {integrity: sha512-b33gLVU2k11nVx1OhX3C8QQP6UHQK4ZtN56oFWvVXvz2VkDoe6fbG8TOgHFxEvqeqohmRnIHe5A1+HADk4OQww==} + engines: {node: '>=18'} + cpu: [ia32] + os: [win32] + + '@esbuild/win32-x64@0.25.9': + resolution: {integrity: sha512-PPOl1mi6lpLNQxnGoyAfschAodRFYXJ+9fs6WHXz7CSWKbOqiMZsubC+BQsVKuul+3vKLuwTHsS2c2y9EoKwxQ==} + engines: {node: '>=18'} + cpu: [x64] + os: [win32] + + '@hono/node-server@1.19.0': + resolution: {integrity: sha512-1k8/8OHf5VIymJEcJyVksFpT+AQ5euY0VA5hUkCnlKpD4mr8FSbvXaHblxeTTEr90OaqWzAkQaqD80qHZQKxBA==} + engines: {node: '>=18.14.1'} + peerDependencies: + hono: ^4 + + '@types/node@24.3.0': + resolution: {integrity: sha512-aPTXCrfwnDLj4VvXrm+UUCQjNEvJgNA8s5F1cvwQU+3KNltTOkBm1j30uNLyqqPNe7gE3KFzImYoZEfLhp4Yow==} + + esbuild@0.25.9: + resolution: {integrity: sha512-CRbODhYyQx3qp7ZEwzxOk4JBqmD/seJrzPa/cGjY1VtIn5E09Oi9/dB4JwctnfZ8Q8iT7rioVv5k/FNT/uf54g==} + engines: {node: '>=18'} + hasBin: true + + fsevents@2.3.3: + resolution: {integrity: sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw==} + engines: {node: ^8.16.0 || ^10.6.0 || >=11.0.0} + os: [darwin] + + get-tsconfig@4.10.1: + resolution: {integrity: sha512-auHyJ4AgMz7vgS8Hp3N6HXSmlMdUyhSUrfBF16w153rxtLIEOE+HGqaBppczZvnHLqQJfiHotCYpNhl0lUROFQ==} + + hono@4.9.4: + resolution: {integrity: sha512-61hl6MF6ojTl/8QSRu5ran6GXt+6zsngIUN95KzF5v5UjiX/xnrLR358BNRawwIRO49JwUqJqQe3Rb2v559R8Q==} + engines: {node: '>=16.9.0'} + + resolve-pkg-maps@1.0.0: + resolution: {integrity: sha512-seS2Tj26TBVOC2NIc2rOe2y2ZO7efxITtLZcGSOnHHNOQ7CkiUBfw0Iw2ck6xkIhPwLhKNLS8BO+hEpngQlqzw==} + + tsx@4.20.5: + resolution: {integrity: sha512-+wKjMNU9w/EaQayHXb7WA7ZaHY6hN8WgfvHNQ3t1PnU91/7O8TcTnIhCDYTZwnt8JsO9IBqZ30Ln1r7pPF52Aw==} + engines: {node: '>=18.0.0'} + hasBin: true + + typescript@5.9.2: + resolution: {integrity: sha512-CWBzXQrc/qOkhidw1OzBTQuYRbfyxDXJMVJ1XNwUHGROVmuaeiEm3OslpZ1RV96d7SKKjZKrSJu3+t/xlw3R9A==} + engines: {node: '>=14.17'} + hasBin: true + + undici-types@7.10.0: + resolution: {integrity: sha512-t5Fy/nfn+14LuOc2KNYg75vZqClpAiqscVvMygNnlsHBFpSXdJaYtXMcdNLpl/Qvc3P2cB3s6lOV51nqsFq4ag==} + +snapshots: + + '@esbuild/aix-ppc64@0.25.9': + optional: true + + '@esbuild/android-arm64@0.25.9': + optional: true + + '@esbuild/android-arm@0.25.9': + optional: true + + '@esbuild/android-x64@0.25.9': + optional: true + + '@esbuild/darwin-arm64@0.25.9': + optional: true + + '@esbuild/darwin-x64@0.25.9': + optional: true + + '@esbuild/freebsd-arm64@0.25.9': + optional: true + + '@esbuild/freebsd-x64@0.25.9': + optional: true + + '@esbuild/linux-arm64@0.25.9': + optional: true + + '@esbuild/linux-arm@0.25.9': + optional: true + + '@esbuild/linux-ia32@0.25.9': + optional: true + + '@esbuild/linux-loong64@0.25.9': + optional: true + + '@esbuild/linux-mips64el@0.25.9': + optional: true + + '@esbuild/linux-ppc64@0.25.9': + optional: true + + '@esbuild/linux-riscv64@0.25.9': + optional: true + + '@esbuild/linux-s390x@0.25.9': + optional: true + + '@esbuild/linux-x64@0.25.9': + optional: true + + '@esbuild/netbsd-arm64@0.25.9': + optional: true + + '@esbuild/netbsd-x64@0.25.9': + optional: true + + '@esbuild/openbsd-arm64@0.25.9': + optional: true + + '@esbuild/openbsd-x64@0.25.9': + optional: true + + '@esbuild/openharmony-arm64@0.25.9': + optional: true + + '@esbuild/sunos-x64@0.25.9': + optional: true + + '@esbuild/win32-arm64@0.25.9': + optional: true + + '@esbuild/win32-ia32@0.25.9': + optional: true + + '@esbuild/win32-x64@0.25.9': + optional: true + + '@hono/node-server@1.19.0(hono@4.9.4)': + dependencies: + hono: 4.9.4 + + '@types/node@24.3.0': + dependencies: + undici-types: 7.10.0 + + esbuild@0.25.9: + optionalDependencies: + '@esbuild/aix-ppc64': 0.25.9 + '@esbuild/android-arm': 0.25.9 + '@esbuild/android-arm64': 0.25.9 + '@esbuild/android-x64': 0.25.9 + '@esbuild/darwin-arm64': 0.25.9 + '@esbuild/darwin-x64': 0.25.9 + '@esbuild/freebsd-arm64': 0.25.9 + '@esbuild/freebsd-x64': 0.25.9 + '@esbuild/linux-arm': 0.25.9 + '@esbuild/linux-arm64': 0.25.9 + '@esbuild/linux-ia32': 0.25.9 + '@esbuild/linux-loong64': 0.25.9 + '@esbuild/linux-mips64el': 0.25.9 + '@esbuild/linux-ppc64': 0.25.9 + '@esbuild/linux-riscv64': 0.25.9 + '@esbuild/linux-s390x': 0.25.9 + '@esbuild/linux-x64': 0.25.9 + '@esbuild/netbsd-arm64': 0.25.9 + '@esbuild/netbsd-x64': 0.25.9 + '@esbuild/openbsd-arm64': 0.25.9 + '@esbuild/openbsd-x64': 0.25.9 + '@esbuild/openharmony-arm64': 0.25.9 + '@esbuild/sunos-x64': 0.25.9 + '@esbuild/win32-arm64': 0.25.9 + '@esbuild/win32-ia32': 0.25.9 + '@esbuild/win32-x64': 0.25.9 + + fsevents@2.3.3: + optional: true + + get-tsconfig@4.10.1: + dependencies: + resolve-pkg-maps: 1.0.0 + + hono@4.9.4: {} + + resolve-pkg-maps@1.0.0: {} + + tsx@4.20.5: + dependencies: + esbuild: 0.25.9 + get-tsconfig: 4.10.1 + optionalDependencies: + fsevents: 2.3.3 + + typescript@5.9.2: {} + + undici-types@7.10.0: {} diff --git a/lib/data/spatial/tree-app-tiles/server.ts b/lib/data/spatial/tree-app-tiles/server.ts new file mode 100644 index 00000000..b9c5fe67 --- /dev/null +++ b/lib/data/spatial/tree-app-tiles/server.ts @@ -0,0 +1,77 @@ +import { Hono } from 'hono' +import fs from 'fs' +import path from 'path' +import { serve } from '@hono/node-server' + +const app = new Hono() +const baseDir = path.join(process.cwd(), 'tiles') + +// Serve tiles.txt at root +app.get('/tiles.txt', async (c) => { + const filePath = path.join(baseDir, 'tiles.txt') + try { + const content = await fs.promises.readFile(filePath, 'utf-8') + c.header('Content-Type', 'text/plain') + c.header('Cache-Control', 'public, max-age=3600') + c.header('Access-Control-Allow-Origin', '*') + return c.text(content) + } catch (err) { + console.error('tiles.txt not found', err) + return c.text('File not found', 404) + } +}) + +// Serve tree tiles (gzipped) +app.get('/tree/:z/:x/:y', async (c) => { + try { + const folder = 'tree' + const z = decodeURIComponent(c.req.param('z')) + const x = decodeURIComponent(c.req.param('x')) + const y = decodeURIComponent(c.req.param('y')) + + const filePath = path.join(baseDir, folder, z, x, y) + + await fs.promises.access(filePath) + const tileBuffer = await fs.promises.readFile(filePath) + + c.header('Content-Type', 'application/x-protobuf') + c.header('Content-Encoding', 'gzip') + c.header('Cache-Control', 'public, max-age=31536000, immutable') + c.header('Access-Control-Allow-Origin', '*') + + return c.body(new Uint8Array(tileBuffer)) + } catch (err) { + console.error('Tree tile not found:', err) + return c.text('Tile not found', 404) + } +}) + +// Serve fonts tiles (raw, supports spaces and nested folders) +app.get('/fonts/*', async (c) => { + try { + // Remove '/fonts/' from path and decode + const relativePath = decodeURIComponent(c.req.path.replace(/^\/fonts\//, '')) + const filePath = path.join(baseDir, 'fonts', relativePath) + + await fs.promises.access(filePath) + const tileBuffer = await fs.promises.readFile(filePath) + + c.header('Content-Type', 'application/x-protobuf') + c.header('Content-Encoding', 'identity') + c.header('Cache-Control', 'public, max-age=31536000, immutable') + c.header('Access-Control-Allow-Origin', '*') + + return c.body(new Uint8Array(tileBuffer)) + } catch (err) { + console.error('Font tile not found:', err) + return c.text('Tile not found', 404) + } +}) + +// Start local server +serve({ + fetch: app.fetch, + port: 3000, +}) + +console.log('Server running at http://localhost:3000') diff --git a/lib/data/spatial/tree-app-tiles/tsconfig.json b/lib/data/spatial/tree-app-tiles/tsconfig.json new file mode 100644 index 00000000..b3a742da --- /dev/null +++ b/lib/data/spatial/tree-app-tiles/tsconfig.json @@ -0,0 +1,15 @@ +{ + "compilerOptions": { + "target": "ES2022", + "module": "ESNext", + "moduleResolution": "Node", + "outDir": "dist", + "esModuleInterop": true, + "forceConsistentCasingInFileNames": true, + "strict": true, + "skipLibCheck": true, + "types": ["node"], + "lib": ["ES2022", "DOM"] + }, + "include": ["server.ts"] +} \ No newline at end of file diff --git a/lib/package.json b/lib/package.json index 5270fd37..668804e5 100644 --- a/lib/package.json +++ b/lib/package.json @@ -18,8 +18,8 @@ "data:spatial:export": "cd data && docker-compose exec db sh -c '/data/spatial/2-export.sh'", "data:spatial:tile": "cd data && docker-compose exec tippecanoe sh -c '/data/spatial/3-tile.sh'", "data:spatial:fonts": "./data/spatial/4-fonts.sh", - "data:spatial:deploy": "vercel deploy --cwd ./data/spatial/tiles", - "data:spatial:deploy:local": "vercel dev --cwd ./data/spatial/tiles", + "data:spatial:deploy": "cd data/spatial/tree-app-tiles && pnpm install && pnpm build && vercel deploy --cwd .", + "data:spatial:deploy:local": "vercel dev --cwd ./data/spatial/tree-app-tiles", "data:export:csv": "node --experimental-json-modules export/src/export_csv.mjs", "doc:build": "documentation build src/** --format html --output doc --config documentation.yml", "doc:serve": "documentation serve --config documentation.yml --watch src/**",