diff --git a/next.config.mjs b/next.config.mjs index 7f56bd33..6ffac601 100644 --- a/next.config.mjs +++ b/next.config.mjs @@ -24,6 +24,9 @@ const getNextConfig = async (phase) => { "process.env.NEXT_PUBLIC_SO_PDF_ENDPOINT": JSON.stringify( process.env.NEXT_PUBLIC_SO_PDF_ENDPOINT, ), + "process.env.NEXT_PUBLIC_TREE_PDF_ENDPOINT": JSON.stringify( + process.env.NEXT_PUBLIC_TREE_PDF_ENDPOINT, + ), }), ); config.module.rules.push({ @@ -43,6 +46,7 @@ const getNextConfig = async (phase) => { return config; }, env: { + NEXT_PUBLIC_TREE_PDF_ENDPOINT: process.env.NEXT_PUBLIC_TREE_PDF_ENDPOINT, NEXT_PUBLIC_VECTOR_TILES_ENDPOINT: process.env.NEXT_PUBLIC_VECTOR_TILES_ENDPOINT, NEXT_PUBLIC_SO_PDF_ENDPOINT: process.env.NEXT_PUBLIC_SO_PDF_ENDPOINT, diff --git a/package.json b/package.json index 0ac4a0da..38a81843 100644 --- a/package.json +++ b/package.json @@ -16,9 +16,9 @@ "@heroicons/react": "2.1.5", "@serwist/next": "9.0.7", "@serwist/sw": "9.0.8", - "@types/react": "18.3.4", "@tailwindcss/container-queries": "0.1.1", "@types/node": "20.16.2", + "@types/react": "18.3.4", "@upstash/redis": "1.34.3", "assert": "2.1.0", "docx": "9.1.0", @@ -30,7 +30,7 @@ "is-svg": "5.1.0", "lodash.get": "4.4.2", "lodash.intersection": "4.4.0", - "maplibre-gl": "4.4.1", + "maplibre-gl": "5.6.2", "next": "14.2.26", "ol": "10.0.0", "prisma": "5.19.0", @@ -43,12 +43,14 @@ "react-select": "5.8.3", "react-tooltip": "5.28.0", "save-svg-as-png": "1.4.17", - "sql.js": "1.11.0", - "url-loader": "4.1.1", - "uuid": "10.0.0", "serwist": "9.0.7", + "sql.js": "1.11.0", "tailwindcss": "3.4.1", "typescript": "5.6.3", + "url-loader": "4.1.1", + "uuid": "10.0.0", + "workbox-precaching": "^7.3.0", + "workbox-routing": "^7.3.0", "zustand": "5.0.0-rc.2" }, "devDependencies": { diff --git a/pages/index.tsx b/pages/index.tsx index f276fd16..13f7b0d3 100644 --- a/pages/index.tsx +++ b/pages/index.tsx @@ -1,5 +1,11 @@ import Location from "./location"; +import type { GetStaticProps } from "next"; + +export const getStaticProps: GetStaticProps = () => { + return { props: {} }; // static HTML will be generated at build +}; + export default function Index() { return ; } diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index b1cfb3a2..6f07cb48 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -69,8 +69,8 @@ importers: specifier: 4.4.0 version: 4.4.0 maplibre-gl: - specifier: 4.4.1 - version: 4.4.1 + specifier: 5.6.2 + version: 5.6.2 next: specifier: 14.2.26 version: 14.2.26(react-dom@18.3.1(react@18.3.1))(react@18.3.1) @@ -125,6 +125,12 @@ importers: uuid: specifier: 10.0.0 version: 10.0.0 + workbox-precaching: + specifier: ^7.3.0 + version: 7.3.0 + workbox-routing: + specifier: ^7.3.0 + version: 7.3.0 zustand: specifier: 5.0.0-rc.2 version: 5.0.0-rc.2(@types/react@18.3.4)(immer@10.1.1)(react@18.3.1) @@ -396,26 +402,29 @@ packages: resolution: {integrity: sha512-rY0o9A5ECsTQRVhv7tL/OyDpGAoUB4tTvLiW1DSzQGq4bvTPhNw1VpSNjDJc5GFZ2XuyOtSWSVN05qOtcD71qQ==} engines: {node: '>= 0.6'} - '@mapbox/point-geometry@0.1.0': - resolution: {integrity: sha512-6j56HdLTwWGO0fJPlrZtdU/B13q8Uwmo18Ck2GnGgN9PCFyKTZ3UbXeEdRFh18i9XQ92eH2VdtpJHpBD3aripQ==} + '@mapbox/point-geometry@1.1.0': + resolution: {integrity: sha512-YGcBz1cg4ATXDCM/71L9xveh4dynfGmcLDqufR+nQQy3fKwsAZsWd/x4621/6uJaeB9mwOHE6hPeDgXz9uViUQ==} - '@mapbox/tiny-sdf@2.0.6': - resolution: {integrity: sha512-qMqa27TLw+ZQz5Jk+RcwZGH7BQf5G/TrutJhspsca/3SHwmgKQ1iq+d3Jxz5oysPVYTGP6aXxCo5Lk9Er6YBAA==} + '@mapbox/tiny-sdf@2.0.7': + resolution: {integrity: sha512-25gQLQMcpivjOSA40g3gO6qgiFPDpWRoMfd+G/GoppPIeP6JDaMMkMrEJnMZhKyyS6iKwVt5YKu02vCUyJM3Ug==} '@mapbox/unitbezier@0.0.1': resolution: {integrity: sha512-nMkuDXFv60aBr9soUG5q+GvZYL+2KZHVvsqFCzqnkGEf46U2fvmytHaEVc1/YZbiLn8X+eR3QzX1+dwDO1lxlw==} - '@mapbox/vector-tile@1.3.1': - resolution: {integrity: sha512-MCEddb8u44/xfQ3oD+Srl/tNcQoqTw3goGk2oLsrFxOTc3dUp+kAnby3PvAeeBYSMSjSPD1nd1AJA6W49WnoUw==} + '@mapbox/vector-tile@2.0.4': + resolution: {integrity: sha512-AkOLcbgGTdXScosBWwmmD7cDlvOjkg/DetGva26pIRiZPdeJYjYKarIlb4uxVzi6bwHO6EWH82eZ5Nuv4T5DUg==} '@mapbox/whoots-js@3.1.0': resolution: {integrity: sha512-Es6WcD0nO5l+2BOQS4uLfNPYQaNDfbot3X1XUoloz+x0mPDS3eeORZJl06HXjwBG1fOGwCRnzK88LMdxKRrd6Q==} engines: {node: '>=6.0.0'} - '@maplibre/maplibre-gl-style-spec@20.4.0': - resolution: {integrity: sha512-AzBy3095fTFPjDjmWpR2w6HVRAZJ6hQZUCwk5Plz6EyfnfuQW1odeW5i2Ai47Y6TBA2hQnC+azscjBSALpaWgw==} + '@maplibre/maplibre-gl-style-spec@23.3.0': + resolution: {integrity: sha512-IGJtuBbaGzOUgODdBRg66p8stnwj9iDXkgbYKoYcNiiQmaez5WVRfXm4b03MCDwmZyX93csbfHFWEJJYHnn5oA==} hasBin: true + '@maplibre/vt-pbf@4.0.3': + resolution: {integrity: sha512-YsW99BwnT+ukJRkseBcLuZHfITB4puJoxnqPVjo72rhW/TaawVYsgQHcqWLzTxqknttYoDpgyERzWSa/XrETdA==} + '@next/env@14.2.26': resolution: {integrity: sha512-vO//GJ/YBco+H7xdQhzJxF7ub3SUwft76jwaeOyVVQFHCi5DCnkP16WHB+JBylo4vOKPoZBlR94Z8xBxNBdNJA==} @@ -725,6 +734,9 @@ packages: '@types/geojson@7946.0.14': resolution: {integrity: sha512-WCfD5Ht3ZesJUsONdhvm84dmzWOiOzOAqOncN0++w0lBw1o8OuDNJF2McvvCef/yBqb/HYRahp1BYtODFQ8bRg==} + '@types/geojson@7946.0.16': + resolution: {integrity: sha512-6C8nqWur3j98U6+lXDfTUWIfgvZU+EumvpHKcYjujKH7woYyLj2sUmff0tRhrqM7BohUw7Pz3ZB1jj2gW9Fvmg==} + '@types/history@4.7.11': resolution: {integrity: sha512-qjDJRrmvBMiTx+jyLxvLfJU7UznFuokDv4f3WRuriHKERccVpFU+8XMQUAbDzoiJCsmexxRExQeMwwCdamSKDA==} @@ -734,9 +746,6 @@ packages: '@types/json5@0.0.29': resolution: {integrity: sha512-dRLjCWHYg4oaA77cxO64oO+7JwCwnIzkZPdrrC71jQmQtlhM556pwKo5bUzqvZndkVbeFLIIi+9TC40JNF5hNQ==} - '@types/junit-report-builder@3.0.2': - resolution: {integrity: sha512-R5M+SYhMbwBeQcNXYWNCZkl09vkVfAtcPIaCGdzIkkbeaTrVbGQ7HVgi4s+EmM/M1K4ZuWQH0jGcvMvNePfxYA==} - '@types/lodash.get@4.4.9': resolution: {integrity: sha512-J5dvW98sxmGnamqf+/aLP87PYXyrha9xIgc2ZlHl6OHMFR2Ejdxep50QfU0abO1+CH6+ugx+8wEUN1toImAinA==} @@ -746,12 +755,6 @@ packages: '@types/lodash@4.17.13': resolution: {integrity: sha512-lfx+dftrEZcdBPczf9d0Qv0x+j/rfNCMuC6OcfXmO8gkfeNAY88PgKUbvG56whcN23gc27yenwF6oJZXGFpYxg==} - '@types/mapbox__point-geometry@0.1.4': - resolution: {integrity: sha512-mUWlSxAmYLfwnRBmgYV86tgYmMIICX4kza8YnE/eIlywGe2XoOxlpVnXWwir92xRLjwyarqwpu2EJKD2pk0IUA==} - - '@types/mapbox__vector-tile@1.3.4': - resolution: {integrity: sha512-bpd8dRn9pr6xKvuEBQup8pwQfD4VUyqO/2deGjfpe6AwC8YRlyEipvefyRJUSiCJTZuCb8Pl1ciVV5ekqJ96Bg==} - '@types/node@20.16.2': resolution: {integrity: sha512-91s/n4qUPV/wg8eE9KHYW1kouTfDk2FPGjXbBMfRWP/2vg1rCXNQL1OCabwGs0XSdukuK+MwCDXE30QpSeMUhQ==} @@ -761,9 +764,6 @@ packages: '@types/parse-json@4.0.2': resolution: {integrity: sha512-dISoDXWWQwUquiKsyZ4Ng+HX2KsPL7LyHKHQwgGFEA3IaKac4Obd+h2a/a6waisAoepJlBcx9paWqjA8/HVjCw==} - '@types/pbf@3.0.5': - resolution: {integrity: sha512-j3pOPiEcWZ34R6a6mN07mUkM4o4Lwf6hPNt8eilOeZhTFbxFXmKhvXl9Y28jotFPaI1bpPDJsbCprUoNke6OrA==} - '@types/proj4@2.5.5': resolution: {integrity: sha512-y4tHUVVoMEOm2nxRLQ2/ET8upj/pBmoutGxFw2LZJTQWPgWXI+cbxVEUFFmIzr/bpFR83hGDOTSXX6HBeObvZA==} @@ -1517,12 +1517,12 @@ packages: resolution: {integrity: sha512-KIN/nDJBQRcXw0MLVhZE9iQHmG68qAVIBg9CqmUYjmQIhgij9U5MFvrqkUL5FbtyyzZuOeOt0zdeRe4UY7ct+A==} engines: {node: '>= 0.4'} - earcut@2.2.4: - resolution: {integrity: sha512-/pjZsA1b4RPHbeWZQn66SWS8nZZWLQQ23oE3Eam7aroEFGEvwKAsJfZ9ytiEMycfzXWpca4FA9QIOehf7PocBQ==} - earcut@3.0.0: resolution: {integrity: sha512-41Fs7Q/PLq1SDbqjsgcY7GA42T0jvaCNGXgGtsNdvg+Yv8eIu06bxv4/PoREkZ9nMDNwnUSG9OFB9+yv8eKhDg==} + earcut@3.0.2: + resolution: {integrity: sha512-X7hshQbLyMJ/3RPhyObLARM2sNxxmRALLKx1+NVFFnQ9gKzmCrxm9+uLIAdBcvc8FNLpctqlQ2V6AE92Ol9UDQ==} + eastasianwidth@0.2.0: resolution: {integrity: sha512-I88TYZWc9XiYHRQ4/3c5rjjfgkjhLyW2luGIheGERbNQ6OY7yTybanSpDXZa8y7VUP9YmDcYa+eyq4ca7iLqWA==} @@ -1901,8 +1901,8 @@ packages: functions-have-names@1.2.3: resolution: {integrity: sha512-xckBUXyTIqT97tq2x2AMb+g163b5JFysYk0x4qxNFwbfQkmNZoiRHb6sPzI9/QV33WeuvVYBUIiD4NzNIyqaRQ==} - geojson-vt@3.2.1: - resolution: {integrity: sha512-EvGQQi/zPrDA6zr6BnJD/YhwAkBP8nnJ9emh3EnHQKVMfg/MRVtPbMYdgVy/IaEmn4UfagD2a6fafPDL5hbtwg==} + geojson-vt@4.0.2: + resolution: {integrity: sha512-AV9ROqlNqoZEIJGfm1ncNjEXfkz2hdFlZf0qkVfmkwdKa8vj7H16YUOT81rJw1rdFhyEDlN2Tds91p/glzbl5A==} geotiff@2.1.3: resolution: {integrity: sha512-PT6uoF5a1+kbC3tHmZSUsLHBp2QJlHasxxxxPW47QIY1VBKpFB+FcDvX+MxER6UzgLQZ0xDzJ9s48B9JbOCTqA==} @@ -1975,10 +1975,6 @@ packages: resolution: {integrity: sha512-NBcGGFbBA9s1VzD41QXDG+3++t9Mn5t1FpLdhESY6oKY4gYTFpX4wO3sqGUa0Srjtbfj3szX0RnemmrVRUdULA==} engines: {node: '>=10'} - global-prefix@3.0.0: - resolution: {integrity: sha512-awConJSVCHVGND6x3tmMaKcQvwXLhjdkmomy2W+Goaui8YPgYgXJZewhg3fWC+DlfqqQuWg8AwqjGTD2nAPVWg==} - engines: {node: '>=6'} - globals@11.12.0: resolution: {integrity: sha512-WOBp/EEGUiIsJSp7wcv/y6MO+lV9UoncWqxuFfm8eBwzWNgyfBd6Gz+IeKQ9jCmyhoH99g15M3T+QaVHFjizVA==} engines: {node: '>=4'} @@ -2379,10 +2375,6 @@ packages: keyv@4.5.4: resolution: {integrity: sha512-oxVHkHR/EJf2CNXnWxRLW6mg7JyCCUcG0DtEGmL2ctUo1PNTin1PUil+r/+4r5MpVgC/fn1kjsx7mjSujKqIpw==} - kind-of@6.0.3: - resolution: {integrity: sha512-dcS1ul+9tmeD95T+x28/ehLgd9mENa3LsvDTtzm3vyBEO7RPptvAD+t44WVXaUjTBRcrpFeFlC8WCruUR456hw==} - engines: {node: '>=0.10.0'} - language-subtag-registry@0.3.23: resolution: {integrity: sha512-0K65Lea881pHotoGEa5gDlMxt3pctLi2RplBb7Ezh4rRdLEOtgi7n4EwK9lamnUCkKBqaeKRVebTq6BAxSkpXQ==} @@ -2476,8 +2468,8 @@ packages: make-event-props@1.6.2: resolution: {integrity: sha512-iDwf7mA03WPiR8QxvcVHmVWEPfMY1RZXerDVNCRYW7dUr2ppH3J58Rwb39/WG39yTZdRSxr3x+2v22tvI0VEvA==} - maplibre-gl@4.4.1: - resolution: {integrity: sha512-tD+wn8qWSLCGhABKBrbewmgFfyopZDz+fkYXeOM8vdBhnf126DvMPyaYGGoKvoF4QuswCsgikETd2c39wK+OQw==} + maplibre-gl@5.6.2: + resolution: {integrity: sha512-SEqYThhUCFf6Lm0TckpgpKnto5u4JsdPYdFJb6g12VtuaFsm3nYdBO+fOmnUYddc8dXihgoGnuXvPPooUcRv5w==} engines: {node: '>=16.14.0', npm: '>=8.1.0'} math-intrinsics@1.1.0: @@ -2741,10 +2733,6 @@ packages: resolution: {integrity: sha512-+vnG6S4dYcYxZd+CZxzXCNKdELYZSKfohrk98yajCo1PtRoDgCTrrwOvK1GT0UoAdVszagDVllQc0U1vaX4NUQ==} engines: {node: '>=6'} - pbf@3.3.0: - resolution: {integrity: sha512-XDF38WCH3z5OV/OVa8GKUNtLAyneuzbCisx7QUCF8Q6Nutx0WnJrQe5O+kOtBlLfRNUws98Y58Lblp+NJG5T4Q==} - hasBin: true - pbf@4.0.1: resolution: {integrity: sha512-SuLdBvS42z33m8ejRbInMapQe8n0D3vN/Xd5fmWM3tufNgRQFBpaW2YVJxQZV4iPNqb0vEFvssMEo5w9c6BTIA==} hasBin: true @@ -2823,8 +2811,8 @@ packages: resolution: {integrity: sha512-OCVPnIObs4N29kxTjzLfUryOkvZEq+pf8jTF0lg8E7uETuWHA+v7j3c/xJmiqpX450191LlmZfUKkXxkTry7nA==} engines: {node: ^10 || ^12 || >=14} - potpack@2.0.0: - resolution: {integrity: sha512-Q+/tYsFU9r7xoOJ+y/ZTtdVQwTWfzjbiXBDMM/JKUux3+QPP02iUuIoeBQ+Ot6oEDlC+/PGjB/5A3K7KKb7hcw==} + potpack@2.1.0: + resolution: {integrity: sha512-pcaShQc1Shq0y+E7GqJqvZj8DTthWV1KeHGdi0Z6IAin2Oi3JnLCOfwnCo84qc+HAp52wT9nK9H7FAJp5a44GQ==} prebuild-install@7.1.2: resolution: {integrity: sha512-UnNke3IQb6sgarcZIDU3gbMeTp/9SSU1DAIkil7PrqG1vZlBtY5msYccSKSHDqa3hNg436IXK+SNImReuA1wEQ==} @@ -2942,9 +2930,6 @@ packages: resolution: {integrity: sha512-AAFUA5O1d83pIHEhJwWCq/RQcRukCkn/NSm2QsTEMle5f2hP0ChI2+3Xb051PZCkLryI/Ir1MVKviT2FIloaTQ==} engines: {node: '>=12'} - quickselect@2.0.0: - resolution: {integrity: sha512-RKJ22hX8mHe3Y6wH/N3wCM6BWtjaxIyyUIkpHOvfFnxdI4yD4tBXEBKSbriGujF6jnSVkJrffuo6vxACiSSxIw==} - quickselect@3.0.0: resolution: {integrity: sha512-XdjUArbK4Bm5fLLvlm5KpTFOiOThgfWWI4axAZDWg4E/0mKdZyI9tNEfds27qCi1ze/vwTR16kvmmGhRra3c2g==} @@ -3406,9 +3391,6 @@ packages: tiny-invariant@1.3.3: resolution: {integrity: sha512-+FbBPE1o9QAYvviau/qC5SE3caw21q3xkvWKBtja5vgqOWIHHJ3ioaq1VPfn/Szqctz2bU/oYeKd9/z5BL+PVg==} - tinyqueue@2.0.3: - resolution: {integrity: sha512-ppJZNDuKGgxzkHihX8v9v9G5f+18gzaTfrukGrq6ueg0lmH4nqVnA2IPG0AEH3jKEk2GRJCUhDoqpoiw3PHLBA==} - tinyqueue@3.0.0: resolution: {integrity: sha512-gRa9gwYU3ECmQYv3lslts5hxuIa90veaEcxDYuu3QGOIAEM2mOZkVHp48ANJuu1CURtRdHKUBY5Lm1tHV+sD4g==} @@ -3555,9 +3537,6 @@ packages: resolution: {integrity: sha512-Dhxzh5HZuiHQhbvTW9AMetFfBHDMYpo23Uo9btPXgdYP+3T5S+p+jgNy7spra+veYhBP2dCSgxR/i2Y02h5/6w==} engines: {node: '>=0.10.0'} - vt-pbf@3.1.3: - resolution: {integrity: sha512-2LzDFzt0mZKZ9IpVF2r69G9bXaP2Q2sArJCmcCgvfTdCCZzSyz4aCLoQyUilu37Ll56tCblIZrXFIjNUpGIlmA==} - warning@4.0.3: resolution: {integrity: sha512-rpJyN222KWIvHJ/F53XSZv0Zl/accqHR8et1kpaMTD/fLCRxtV8iX8czMzY7sVZupTI3zcUTg8eycS2kNF9l6w==} @@ -3603,10 +3582,6 @@ packages: resolution: {integrity: sha512-oV0jmFtUky6CXfkqehVvBP/LSWJ2sy4vWMioiENyJLePrBO/yKyV9OyJySfAKosh+RYkIl5zJCNZ8/4JncrpdA==} engines: {node: '>= 0.4'} - which@1.3.1: - resolution: {integrity: sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ==} - hasBin: true - which@2.0.2: resolution: {integrity: sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==} engines: {node: '>= 8'} @@ -3619,6 +3594,18 @@ packages: resolution: {integrity: sha512-BN22B5eaMMI9UMtjrGd5g5eCYPpCPDUy0FJXbYsaT5zYxjFOckS53SQDE3pWkVoWpHXVb3BrYcEN4Twa55B5cA==} engines: {node: '>=0.10.0'} + workbox-core@7.3.0: + resolution: {integrity: sha512-Z+mYrErfh4t3zi7NVTvOuACB0A/jA3bgxUN3PwtAVHvfEsZxV9Iju580VEETug3zYJRc0Dmii/aixI/Uxj8fmw==} + + workbox-precaching@7.3.0: + resolution: {integrity: sha512-ckp/3t0msgXclVAYaNndAGeAoWQUv7Rwc4fdhWL69CCAb2UHo3Cef0KIUctqfQj1p8h6aGyz3w8Cy3Ihq9OmIw==} + + workbox-routing@7.3.0: + resolution: {integrity: sha512-ZUlysUVn5ZUzMOmQN3bqu+gK98vNfgX/gSTZ127izJg/pMMy4LryAthnYtjuqcjkN4HEAx1mdgxNiKJMZQM76A==} + + workbox-strategies@7.3.0: + resolution: {integrity: sha512-tmZydug+qzDFATwX7QiEL5Hdf7FrkhjaF9db1CbB39sDmEZJg3l9ayDvPxy8Y18C3Y66Nrr9kkN1f/RlkDgllg==} + wrap-ansi@6.2.0: resolution: {integrity: sha512-r6lPcBGxZXlIcymEu7InxDMhdW0KDxpLgoFLcguasxCaJ/SOIZwINatK9KY/tf+ZrlywOKU0UDj3ATXUBfxJXA==} engines: {node: '>=8'} @@ -3975,28 +3962,40 @@ snapshots: '@mapbox/jsonlint-lines-primitives@2.0.2': {} - '@mapbox/point-geometry@0.1.0': {} + '@mapbox/point-geometry@1.1.0': {} - '@mapbox/tiny-sdf@2.0.6': {} + '@mapbox/tiny-sdf@2.0.7': {} '@mapbox/unitbezier@0.0.1': {} - '@mapbox/vector-tile@1.3.1': + '@mapbox/vector-tile@2.0.4': dependencies: - '@mapbox/point-geometry': 0.1.0 + '@mapbox/point-geometry': 1.1.0 + '@types/geojson': 7946.0.16 + pbf: 4.0.1 '@mapbox/whoots-js@3.1.0': {} - '@maplibre/maplibre-gl-style-spec@20.4.0': + '@maplibre/maplibre-gl-style-spec@23.3.0': dependencies: '@mapbox/jsonlint-lines-primitives': 2.0.2 '@mapbox/unitbezier': 0.0.1 json-stringify-pretty-compact: 4.0.0 minimist: 1.2.8 - quickselect: 2.0.0 + quickselect: 3.0.0 rw: 1.3.3 tinyqueue: 3.0.0 + '@maplibre/vt-pbf@4.0.3': + dependencies: + '@mapbox/point-geometry': 1.1.0 + '@mapbox/vector-tile': 2.0.4 + '@types/geojson-vt': 3.2.5 + '@types/supercluster': 7.1.3 + geojson-vt: 4.0.2 + pbf: 4.0.1 + supercluster: 8.0.1 + '@next/env@14.2.26': {} '@next/eslint-plugin-next@14.2.7': @@ -4257,14 +4256,14 @@ snapshots: '@types/geojson@7946.0.14': {} + '@types/geojson@7946.0.16': {} + '@types/history@4.7.11': {} '@types/json-schema@7.0.15': {} '@types/json5@0.0.29': {} - '@types/junit-report-builder@3.0.2': {} - '@types/lodash.get@4.4.9': dependencies: '@types/lodash': 4.17.13 @@ -4275,14 +4274,6 @@ snapshots: '@types/lodash@4.17.13': {} - '@types/mapbox__point-geometry@0.1.4': {} - - '@types/mapbox__vector-tile@1.3.4': - dependencies: - '@types/geojson': 7946.0.14 - '@types/mapbox__point-geometry': 0.1.4 - '@types/pbf': 3.0.5 - '@types/node@20.16.2': dependencies: undici-types: 6.19.8 @@ -4293,8 +4284,6 @@ snapshots: '@types/parse-json@4.0.2': {} - '@types/pbf@3.0.5': {} - '@types/proj4@2.5.5': {} '@types/prop-types@15.7.13': {} @@ -5186,10 +5175,10 @@ snapshots: es-errors: 1.3.0 gopd: 1.2.0 - earcut@2.2.4: {} - earcut@3.0.0: {} + earcut@3.0.2: {} + eastasianwidth@0.2.0: {} ecc-jsbn@0.1.2: @@ -5370,7 +5359,7 @@ snapshots: debug: 4.3.7(supports-color@8.1.1) enhanced-resolve: 5.17.1 eslint: 8.57.1 - eslint-module-utils: 2.12.0(@typescript-eslint/parser@7.2.0(eslint@8.57.1)(typescript@5.6.3))(eslint-import-resolver-node@0.3.9)(eslint-import-resolver-typescript@3.6.3)(eslint@8.57.1) + eslint-module-utils: 2.12.0(@typescript-eslint/parser@7.2.0(eslint@8.57.1)(typescript@5.6.3))(eslint-import-resolver-node@0.3.9)(eslint-import-resolver-typescript@3.6.3(@typescript-eslint/parser@7.2.0(eslint@8.57.1)(typescript@5.6.3))(eslint-import-resolver-node@0.3.9)(eslint-plugin-import@2.31.0)(eslint@8.57.1))(eslint@8.57.1) fast-glob: 3.3.2 get-tsconfig: 4.8.1 is-bun-module: 1.2.1 @@ -5393,7 +5382,7 @@ snapshots: transitivePeerDependencies: - supports-color - eslint-module-utils@2.12.0(@typescript-eslint/parser@7.2.0(eslint@8.57.1)(typescript@5.6.3))(eslint-import-resolver-node@0.3.9)(eslint-import-resolver-typescript@3.6.3)(eslint@8.57.1): + eslint-module-utils@2.12.0(@typescript-eslint/parser@7.2.0(eslint@8.57.1)(typescript@5.6.3))(eslint-import-resolver-node@0.3.9)(eslint-import-resolver-typescript@3.6.3(@typescript-eslint/parser@7.2.0(eslint@8.57.1)(typescript@5.6.3))(eslint-import-resolver-node@0.3.9)(eslint-plugin-import@2.31.0)(eslint@8.57.1))(eslint@8.57.1): dependencies: debug: 3.2.7(supports-color@8.1.1) optionalDependencies: @@ -5719,7 +5708,7 @@ snapshots: functions-have-names@1.2.3: {} - geojson-vt@3.2.1: {} + geojson-vt@4.0.2: {} geotiff@2.1.3: dependencies: @@ -5827,12 +5816,6 @@ snapshots: dependencies: ini: 2.0.0 - global-prefix@3.0.0: - dependencies: - ini: 1.3.8 - kind-of: 6.0.3 - which: 1.3.1 - globals@11.12.0: {} globals@13.24.0: @@ -5968,7 +5951,8 @@ snapshots: inherits@2.0.4: {} - ini@1.3.8: {} + ini@1.3.8: + optional: true ini@2.0.0: {} @@ -6214,8 +6198,6 @@ snapshots: dependencies: json-buffer: 3.0.1 - kind-of@6.0.3: {} - language-subtag-registry@0.3.23: {} language-tags@1.0.9: @@ -6300,35 +6282,30 @@ snapshots: make-event-props@1.6.2: {} - maplibre-gl@4.4.1: + maplibre-gl@5.6.2: dependencies: '@mapbox/geojson-rewind': 0.5.2 '@mapbox/jsonlint-lines-primitives': 2.0.2 - '@mapbox/point-geometry': 0.1.0 - '@mapbox/tiny-sdf': 2.0.6 + '@mapbox/point-geometry': 1.1.0 + '@mapbox/tiny-sdf': 2.0.7 '@mapbox/unitbezier': 0.0.1 - '@mapbox/vector-tile': 1.3.1 + '@mapbox/vector-tile': 2.0.4 '@mapbox/whoots-js': 3.1.0 - '@maplibre/maplibre-gl-style-spec': 20.4.0 - '@types/geojson': 7946.0.14 + '@maplibre/maplibre-gl-style-spec': 23.3.0 + '@maplibre/vt-pbf': 4.0.3 + '@types/geojson': 7946.0.16 '@types/geojson-vt': 3.2.5 - '@types/junit-report-builder': 3.0.2 - '@types/mapbox__point-geometry': 0.1.4 - '@types/mapbox__vector-tile': 1.3.4 - '@types/pbf': 3.0.5 '@types/supercluster': 7.1.3 - earcut: 2.2.4 - geojson-vt: 3.2.1 + earcut: 3.0.2 + geojson-vt: 4.0.2 gl-matrix: 3.4.3 - global-prefix: 3.0.0 kdbush: 4.0.2 murmurhash-js: 1.0.0 - pbf: 3.3.0 - potpack: 2.0.0 - quickselect: 2.0.0 + pbf: 4.0.1 + potpack: 2.1.0 + quickselect: 3.0.0 supercluster: 8.0.1 - tinyqueue: 2.0.3 - vt-pbf: 3.1.3 + tinyqueue: 3.0.0 math-intrinsics@1.1.0: {} @@ -6572,11 +6549,6 @@ snapshots: path2d@0.2.2: optional: true - pbf@3.3.0: - dependencies: - ieee754: 1.2.1 - resolve-protobuf-schema: 2.1.0 - pbf@4.0.1: dependencies: resolve-protobuf-schema: 2.1.0 @@ -6643,7 +6615,7 @@ snapshots: picocolors: 1.1.1 source-map-js: 1.2.1 - potpack@2.0.0: {} + potpack@2.1.0: {} prebuild-install@7.1.2: dependencies: @@ -6713,8 +6685,6 @@ snapshots: quick-lru@6.1.2: {} - quickselect@2.0.0: {} - quickselect@3.0.0: {} randombytes@2.1.0: @@ -7282,8 +7252,6 @@ snapshots: tiny-invariant@1.3.3: {} - tinyqueue@2.0.3: {} - tinyqueue@3.0.0: {} tldts-core@6.1.61: {} @@ -7431,12 +7399,6 @@ snapshots: void-elements@3.1.0: {} - vt-pbf@3.1.3: - dependencies: - '@mapbox/point-geometry': 0.1.0 - '@mapbox/vector-tile': 1.3.1 - pbf: 3.3.0 - warning@4.0.3: dependencies: loose-envify: 1.4.0 @@ -7526,10 +7488,6 @@ snapshots: gopd: 1.0.1 has-tostringtag: 1.0.2 - which@1.3.1: - dependencies: - isexe: 2.0.0 - which@2.0.2: dependencies: isexe: 2.0.0 @@ -7538,6 +7496,22 @@ snapshots: word-wrap@1.2.5: {} + workbox-core@7.3.0: {} + + workbox-precaching@7.3.0: + dependencies: + workbox-core: 7.3.0 + workbox-routing: 7.3.0 + workbox-strategies: 7.3.0 + + workbox-routing@7.3.0: + dependencies: + workbox-core: 7.3.0 + + workbox-strategies@7.3.0: + dependencies: + workbox-core: 7.3.0 + wrap-ansi@6.2.0: dependencies: ansi-styles: 4.3.0 diff --git a/sw.ts b/sw.ts index ec0691c6..576a4dab 100644 --- a/sw.ts +++ b/sw.ts @@ -1,5 +1,7 @@ import { defaultCache } from "@serwist/next/worker"; import { Serwist } from "serwist"; +import { createHandlerBoundToURL, precacheAndRoute } from "workbox-precaching"; +import { NavigationRoute, registerRoute } from "workbox-routing"; import type { PrecacheEntry, SerwistGlobalConfig } from "serwist"; @@ -157,10 +159,26 @@ self.addEventListener("fetch", (event) => { } }); +// Necessary to make PWA work on iOS +precacheAndRoute([ + ...(self.__SW_MANIFEST ?? []), + { revision: null, url: "/" }, // precache index.html for offline +]); + +// ----------------------------- +// Navigation route for Page Router +// ----------------------------- +const handler = createHandlerBoundToURL("/"); +const navigationRoute = new NavigationRoute(handler, { + denylist: [/^\/_next\//, /\/api\//, /\/.*\.[^/]+$/], +}); +registerRoute(navigationRoute); + +registerRoute(navigationRoute); + const serwist = new Serwist({ clientsClaim: true, navigationPreload: true, - precacheEntries: self.__SW_MANIFEST, runtimeCaching: defaultCache, skipWaiting: true, });