Skip to content

Commit

Permalink
feat: Added Offline Map Server - Mapeo Map Server
Browse files Browse the repository at this point in the history
* chore: added map-server to main thread

* chore: scaffolded useMapServerQuery

* chore: sampled typings

* chore: JSDoc overload example

* chore: Added custom hooks

* chore: update query invalidation

* chore: update styles endpoint typing to return array

* chore: ran electron-rebuild

* chore: update hooks

* chore: update query invalidation to be more general

* chore: Pr fixes

* chore: updated timout for git workflow

* chore: clean up unused varivble

* chore: github actions set up vscode dev env

* chore: fix vs code github action

* chore: set msvs version

* chore: syntax

* chore: syntax

* chore: set msvs to 2022

* chore: vscode tooling

* chore: set msvs to 2017

* chore: run rebuild github action

* chore: try global install of node-gyp

* chore: take out vscode tooling

* chore: updated github actions

* chore: electron-rebuild only run sqlite3

* chore: debug env

* chore: revert ci to node 14.18

* Hack to fix sodium-native not building

* chore: update to windows latest

* chore: remove native deps causing problems in ci

* chore: add proper script

* chore: fix rimraf

Co-authored-by: Gregor MacLennan <[email protected]>
  • Loading branch information
ErikSin and gmaclennan authored Jan 19, 2023
1 parent a9936c6 commit c989c41
Show file tree
Hide file tree
Showing 12 changed files with 2,316 additions and 75 deletions.
22 changes: 15 additions & 7 deletions .github/workflows/nodejs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,13 @@ jobs:
runs-on: ${{ matrix.config.os }}

strategy:
fail-fast: false
matrix:
config:
- { os: macos-11, arch: x64 }
- { os: ubuntu-latest, arch: x64 }
- { os: windows-latest, arch: x64 }
- { os: windows-latest, arch: ia32 }
- { os: windows-2019, arch: x64 }
- { os: windows-2019, arch: ia32 }
variant:
- main
- icca
Expand All @@ -30,20 +31,26 @@ jobs:
- uses: actions/checkout@v2
with:
fetch-depth: 1
- name: Use Node.js 14.18.X
- name: Use Node.js 14
uses: actions/setup-node@v2
with:
node-version: 14.18
- name: npm ci
- name: npm ci no scripts
uses: nick-invision/retry@v2
with:
timeout_minutes: 10
max_attempts: 5
timeout_minutes: 20
max_attempts: 1
retry_on: error
retry_wait_seconds: 0
command: npm ci
command: npm ci --ignore-scripts
env:
npm_config_arch: ${{matrix.config.arch}}
- name: Remove native deps
run: |
npm run remove-native-deps
- name: post install script
run: |
npm run postinstall
- name: Lint
run: |
npm run lint
Expand All @@ -59,6 +66,7 @@ jobs:
npm run dist -- --${{matrix.config.arch}}
env:
ARCH: ${{matrix.config.arch}}
DEBUG: electron-builder
CI: true
GITHUB_CI_REF: ${{ github.ref }}
GH_TOKEN: ${{ secrets.GH_TOKEN }}
Expand Down
20 changes: 15 additions & 5 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,10 @@ var argv = minimist(process.argv.slice(2), {
default: {
port: 5000,
datadir: path.join(userDataPath, 'kappa.db'),
mapsdir: path.join(userDataPath, 'background-maps'),
tileport: 5005,
mapPrinterPort: 5200
mapPrinterPort: 5200,
mapServerPort: 5300
},
boolean: ['headless', 'debug'],
alias: {
Expand Down Expand Up @@ -88,20 +90,28 @@ if (!gotTheLock) {
try {
// Ensure we have open ports. Small chance the ports could get taken by
// another app before we finish loading, but hopefully unlikely!
const [mapeoServerPort, tileServerPort, mapPrinterPort] = await getPorts([
const [
mapeoServerPort,
tileServerPort,
mapPrinterPort,
mapServerPort
] = await getPorts([
argv.port,
argv.tileport,
argv.mapPrinterPort
argv.mapPrinterPort,
argv.mapServerPort
])
const { headless, debug, datadir } = argv
const { headless, debug, datadir, mapsdir } = argv
logger.timedPromise(
startApp({
mapeoServerPort,
tileServerPort,
mapPrinterPort,
mapServerPort,
headless,
debug,
datadir
datadir,
mapsdir
}),
'Started Mapeo'
)
Expand Down
Loading

0 comments on commit c989c41

Please sign in to comment.