Add progressive web app companion for cross-platform access

Vite + TypeScript PWA that mirrors the Android app's core features:
- Pre-processed shelter data (build-time UTM33N→WGS84 conversion)
- Leaflet map with shelter markers, user location, and offline tiles
- Canvas compass arrow (ported from DirectionArrowView.kt)
- IndexedDB shelter cache with 7-day staleness check
- Service worker with CacheFirst tiles and precached app shell
- i18n for en, nb, nn (ported from Android strings.xml)
- iOS/Android compass handling with low-pass filter
- Respects user map interaction (no auto-snap on pan/zoom)
- Build revision cache-breaker for reliable SW updates

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Ole-Morten Duesund 2026-03-08 17:41:38 +01:00
commit e8428de775
12051 changed files with 1799735 additions and 0 deletions

View file

@ -0,0 +1 @@
github: mafintosh

21
pwa/node_modules/why-is-node-running/LICENSE generated vendored Normal file
View file

@ -0,0 +1,21 @@
The MIT License (MIT)
Copyright (c) 2016 Mathias Buus
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.

104
pwa/node_modules/why-is-node-running/README.md generated vendored Normal file
View file

@ -0,0 +1,104 @@
# why-is-node-running
Node is running but you don't know why? `why-is-node-running` is here to help you.
## Installation
Node 8 and above:
```bash
npm i why-is-node-running -g
```
Earlier Node versions (no longer supported):
```bash
npm i why-is-node-running@v1.x -g
```
## Usage
```js
const log = require('why-is-node-running') // should be your first require
const net = require('net')
function createServer () {
const server = net.createServer()
setInterval(function () {}, 1000)
server.listen(0)
}
createServer()
createServer()
setTimeout(function () {
log() // logs out active handles that are keeping node running
}, 100)
```
Save the file as `example.js`, then execute:
```bash
node ./example.js
```
Here's the output:
```
There are 5 handle(s) keeping the process running
# Timeout
/home/maf/dev/node_modules/why-is-node-running/example.js:6 - setInterval(function () {}, 1000)
/home/maf/dev/node_modules/why-is-node-running/example.js:10 - createServer()
# TCPSERVERWRAP
/home/maf/dev/node_modules/why-is-node-running/example.js:7 - server.listen(0)
/home/maf/dev/node_modules/why-is-node-running/example.js:10 - createServer()
# Timeout
/home/maf/dev/node_modules/why-is-node-running/example.js:6 - setInterval(function () {}, 1000)
/home/maf/dev/node_modules/why-is-node-running/example.js:11 - createServer()
# TCPSERVERWRAP
/home/maf/dev/node_modules/why-is-node-running/example.js:7 - server.listen(0)
/home/maf/dev/node_modules/why-is-node-running/example.js:11 - createServer()
# Timeout
/home/maf/dev/node_modules/why-is-node-running/example.js:13 - setTimeout(function () {
```
**Important Note!**
`unref`ed timers do not prevent the Node process from exiting. If you are running with Node v11.0.0 and above, `unref`ed timers will not be listed in the above list. Unfortunately, this is not supported in node versions below v11.0.0.
## CLI
You can also run `why-is-node-running` as a standalone if you don't want to include it inside your code. Sending `SIGUSR1`/`SIGINFO` signal to the process will produce the log. (`Ctrl + T` on macOS and BSD systems)
```bash
why-is-node-running /path/to/some/file.js
```
```
probing module /path/to/some/file.js
kill -SIGUSR1 31115 for logging
```
To trigger the log:
```
kill -SIGUSR1 31115
```
## Require CLI Option
You can also use the node `-r` option to include `why-is-node-running`:
```bash
node -r why-is-node-running/include /path/to/some/file.js
```
The steps are otherwise the same as the above CLI section
## License
MIT

18
pwa/node_modules/why-is-node-running/cli.js generated vendored Executable file
View file

@ -0,0 +1,18 @@
#!/usr/bin/env node
var spawn = require('child_process').spawn
var path = require('path')
var prog = path.resolve(process.argv[2])
var progArgs = process.argv.slice(3)
console.log('probing program', prog)
var nodeArgs = [
'-r',
path.join(__dirname, 'include.js')
]
var nodeOpts = { stdio: 'inherit' }
var child = spawn('node', nodeArgs.concat(prog).concat(progArgs), nodeOpts)
console.log('kill -SIGUSR1', child.pid, 'for logging')

15
pwa/node_modules/why-is-node-running/example.js generated vendored Normal file
View file

@ -0,0 +1,15 @@
var log = require('./')
var net = require('net')
function createServer () {
var server = net.createServer()
setInterval(function () {}, 1000)
server.listen(0)
}
createServer()
createServer()
setTimeout(function () {
log()
}, 100)

3
pwa/node_modules/why-is-node-running/include.js generated vendored Normal file
View file

@ -0,0 +1,3 @@
var why = require('./')
require('siginfo')(why, true)

67
pwa/node_modules/why-is-node-running/index.js generated vendored Normal file
View file

@ -0,0 +1,67 @@
var asyncHooks = require('async_hooks')
var stackback = require('stackback')
var path = require('path')
var fs = require('fs')
var sep = path.sep
var active = new Map()
var hook = asyncHooks.createHook({
init (asyncId, type, triggerAsyncId, resource) {
if (type === 'TIMERWRAP' || type === 'PROMISE') return
if (type === 'PerformanceObserver' || type === 'RANDOMBYTESREQUEST') return
var err = new Error('whatevs')
var stacks = stackback(err)
active.set(asyncId, {type, stacks, resource})
},
destroy (asyncId) {
active.delete(asyncId)
}
})
hook.enable()
module.exports = whyIsNodeRunning
function whyIsNodeRunning (logger) {
if (!logger) logger = console
hook.disable()
var activeResources = [...active.values()].filter(function(r) {
if (
typeof r.resource.hasRef === 'function'
&& !r.resource.hasRef()
) return false
return true
})
logger.error('There are %d handle(s) keeping the process running', activeResources.length)
for (const o of activeResources) printStacks(o)
function printStacks (o) {
var stacks = o.stacks.slice(1).filter(function (s) {
var filename = s.getFileName()
return filename && filename.indexOf(sep) > -1 && filename.indexOf('internal' + sep) !== 0 && filename.indexOf('node:internal' + sep) !== 0
})
logger.error('')
logger.error('# %s', o.type)
if (!stacks[0]) {
logger.error('(unknown stack trace)')
} else {
var padding = ''
stacks.forEach(function (s) {
var pad = (s.getFileName() + ':' + s.getLineNumber()).replace(/./g, ' ')
if (pad.length > padding.length) padding = pad
})
stacks.forEach(function (s) {
var prefix = s.getFileName() + ':' + s.getLineNumber()
try {
var src = fs.readFileSync(s.getFileName(), 'utf-8').split(/\n|\r\n/)
logger.error(prefix + padding.slice(prefix.length) + ' - ' + src[s.getLineNumber() - 1].trim())
} catch (e) {
logger.error(prefix + padding.slice(prefix.length))
}
})
}
}
}

39
pwa/node_modules/why-is-node-running/package.json generated vendored Normal file
View file

@ -0,0 +1,39 @@
{
"name": "why-is-node-running",
"version": "2.3.0",
"description": "Node is running but you don't know why? why-is-node-running is here to help you.",
"main": "index.js",
"dependencies": {
"siginfo": "^2.0.0",
"stackback": "0.0.2"
},
"bin": {
"why-is-node-running": "cli.js"
},
"engines": {
"node": ">=8"
},
"repository": {
"type": "git",
"url": "https://github.com/mafintosh/why-is-node-running.git"
},
"keywords": [
"debug",
"devops",
"test",
"events",
"handles"
],
"author": "Mathias Buus (@mafintosh)",
"contributors": [
{
"name": "Jon Peck",
"email": "jpeck@fluxsauce.com"
}
],
"license": "MIT",
"bugs": {
"url": "https://github.com/mafintosh/why-is-node-running/issues"
},
"homepage": "https://github.com/mafintosh/why-is-node-running"
}