Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: maptiler/tileserver-gl
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v2.4.0
Choose a base ref
...
head repository: maptiler/tileserver-gl
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: master
Choose a head ref
Loading
Showing with 18,755 additions and 3,885 deletions.
  1. +8 −7 .dockerignore
  2. +1 −0 .eslintignore
  3. +36 −0 .eslintrc.cjs
  4. +11 −0 .gitattributes
  5. +19 −0 .github/dependabot.yml
  6. +16 −0 .github/workflows/automerger.yml
  7. +51 −0 .github/workflows/ci.yml
  8. +37 −0 .github/workflows/codeql.yml
  9. +70 −0 .github/workflows/ct.yml
  10. +43 −0 .github/workflows/pipeline.yml
  11. +118 −0 .github/workflows/release.yml
  12. +3 −0 .gitignore
  13. +3 −0 .hadolint.yml
  14. +1 −0 .nvmrc
  15. +1 −0 .prettierignore
  16. +18 −0 .readthedocs.yaml
  17. +0 −21 .travis.yml
  18. +115 −23 Dockerfile
  19. +48 −7 Dockerfile_light
  20. +44 −0 Dockerfile_test
  21. +709 −224 LICENSE.md
  22. +8 −1 PUBLISHING.md
  23. +59 −19 README.md
  24. +22 −4 README_light.md
  25. +3 −0 commitlint.config.cjs
  26. +10 −0 docker-entrypoint.sh
  27. +7 −0 docker-entrypoint_light.sh
  28. +4 −4 docs/conf.py
  29. +159 −20 docs/config.rst
  30. +120 −3 docs/deployment.rst
  31. +75 −14 docs/endpoints.rst
  32. +34 −28 docs/installation.rst
  33. +33 −14 docs/usage.rst
  34. +4 −0 lint-staged.config.cjs
  35. +8,627 −0 package-lock.json
  36. +72 −35 package.json
  37. +13 −0 prettier.config.cjs
  38. +8 −0 public/files/index.html
  39. BIN public/resources/images/header-map-1280px.png
  40. BIN public/resources/images/header-map-1600px.png
  41. BIN public/resources/images/header-map-2560px.png
  42. BIN public/resources/images/header-map-640px.png
  43. BIN public/resources/images/klokantech.png
  44. BIN public/resources/images/layers-2x.png
  45. BIN public/resources/images/layers.png
  46. +67 −0 public/resources/images/maptiler-logo.svg
  47. BIN public/resources/images/marker-icon-2x.png
  48. BIN public/resources/images/marker-icon.png
  49. BIN public/resources/images/marker-shadow.png
  50. +93 −89 public/resources/index.css
  51. +661 −0 public/resources/leaflet.css
  52. +6 −0 public/resources/leaflet.js
  53. +1 −0 public/resources/leaflet.js.map
  54. +0 −40 public/resources/mapbox-gl-inspect.css
  55. +0 −1 public/resources/mapbox-gl-inspect.min.js
  56. +6 −550 public/resources/mapbox-gl-rtl-text.js
  57. +0 −437 public/resources/mapbox-gl.css
  58. +0 −584 public/resources/mapbox-gl.js
  59. +0 −1 public/resources/mapbox.css
  60. +0 −67 public/resources/mapbox.js
  61. +40 −0 public/resources/maplibre-gl-inspect.css
  62. +2,858 −0 public/resources/maplibre-gl-inspect.js
  63. +1 −0 public/resources/maplibre-gl-inspect.js.map
  64. +1 −0 public/resources/maplibre-gl.css
  65. +59 −0 public/resources/maplibre-gl.js
  66. +1 −0 public/resources/maplibre-gl.js.map
  67. +170 −47 public/templates/data.tmpl
  68. +62 −31 public/templates/index.tmpl
  69. +103 −16 public/templates/viewer.tmpl
  70. +393 −19 public/templates/wmts.tmpl
  71. +34 −12 publish.js
  72. +0 −25 run.sh
  73. +18 −0 src/healthcheck.js
  74. +233 −152 src/main.js
  75. +46 −0 src/mbtiles_wrapper.js
  76. +151 −0 src/pmtiles_adapter.js
  77. +14 −0 src/promises.js
  78. +303 −0 src/render.js
  79. +428 −163 src/serve_data.js
  80. +31 −47 src/serve_font.js
  81. +9 −0 src/serve_light.js
  82. +1,177 −629 src/serve_rendered.js
  83. +182 −97 src/serve_style.js
  84. +520 −269 src/server.js
  85. +183 −52 src/utils.js
  86. +32 −31 test/metadata.js
  87. +14 −7 test/setup.js
  88. +142 −34 test/static.js
  89. +41 −25 test/style.js
  90. +8 −8 test/tiles_data.js
  91. +57 −28 test/tiles_rendered.js
15 changes: 8 additions & 7 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
.git
docs/_build
node_modules
test_data
light
config.json
*.mbtiles
*
!src
!public
!test
!package.json
!package-lock.json
!docker-entrypoint.sh
**.gitignore
1 change: 1 addition & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
public
36 changes: 36 additions & 0 deletions .eslintrc.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
module.exports = {
root: true,
env: {
browser: true,
node: true,
es6: true,
},
parserOptions: {
parser: '@typescript-eslint/parser',
ecmaVersion: 2020,
sourceType: 'module',
lib: ['es2020'],
ecmaFeatures: {
jsx: true,
tsx: true,
},
},
plugins: ['prettier', 'jsdoc', 'security'],
extends: [
'prettier',
'plugin:@typescript-eslint/recommended',
'plugin:@typescript-eslint/eslint-recommended',
'plugin:prettier/recommended',
'plugin:jsdoc/recommended',
'plugin:security/recommended',
],
// add your custom rules here
rules: {
'no-console': process.env.NODE_ENV === 'production' ? 'error' : 'off',
'no-debugger': process.env.NODE_ENV === 'production' ? 'error' : 'off',
'@typescript-eslint/no-unused-vars': [
'warn',
{ argsIgnorePattern: 'next|err|info|reject' },
],
},
};
11 changes: 11 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
###############################################################################
# Set default behavior to automatically normalize line endings.
###############################################################################
* text=auto

###############################################################################
# behavior for Unix scripts
#
# Unix scripts are treated as binary by default.
###############################################################################
*.sh eol=lf
19 changes: 19 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
version: 2
updates:
- package-ecosystem: npm
versioning-strategy: increase
directory: '/'
schedule:
interval: daily
commit-message:
prefix: fix
prefix-development: chore
include: scope
- package-ecosystem: github-actions
directory: '/'
schedule:
interval: weekly
commit-message:
prefix: fix
prefix-development: chore
include: scope
16 changes: 16 additions & 0 deletions .github/workflows/automerger.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
name: 'Auto Merge PRs'

on:
workflow_call:

permissions:
pull-requests: write
contents: write

jobs:
automerge:
runs-on: ubuntu-latest
steps:
- uses: fastify/github-action-merge-dependabot@v3
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
51 changes: 51 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
name: 'Continuous Integration'

on:
workflow_call:

permissions:
checks: write
contents: read

jobs:
ci:
runs-on: ubuntu-22.04
steps:
- name: Check out repository ✨ (non-dependabot)
if: ${{ github.actor != 'dependabot[bot]' }}
uses: actions/checkout@v4

- name: Check out repository 🎉 (dependabot)
if: ${{ github.actor == 'dependabot[bot]' }}
uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.sha }}

- name: Setup node env 📦
uses: actions/setup-node@v4
with:
node-version-file: 'package.json'
check-latest: true
cache: 'npm'

- name: Install dependencies 🚀
run: npm ci --prefer-offline --no-audit --omit=optional

- name: Run linter(s) 💅
uses: wearerequired/lint-action@v2
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
continue_on_error: false
git_name: github-actions[bot]
git_email: github-actions[bot]@users.noreply.github.com
auto_fix: false
eslint: true
eslint_extensions: js,cjs,mjs,ts
prettier: true
prettier_extensions: js,cjs,ts,json

- name: Run hadolint 🐳
uses: hadolint/hadolint-action@v3.1.0
with:
dockerfile: Dockerfile
ignore: DL3008,DL3015
37 changes: 37 additions & 0 deletions .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: 'CodeQL'

on:
push:
branches:
- master
pull_request:
branches:
- master
schedule:
- cron: '45 23 * * 2'
jobs:
analyze:
name: Analyze
runs-on: ubuntu-latest
permissions:
actions: read
contents: read
security-events: write
strategy:
fail-fast: false
matrix:
language: [javascript]
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Initialize CodeQL
uses: github/codeql-action/init@v3
with:
languages: ${{ matrix.language }}
queries: +security-and-quality
- name: Autobuild
uses: github/codeql-action/autobuild@v3
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v3
with:
category: '/language:${{ matrix.language }}'
70 changes: 70 additions & 0 deletions .github/workflows/ct.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
name: 'Continuous Testing'

on:
workflow_call:

permissions:
checks: write
contents: read

jobs:
ct:
runs-on: ubuntu-22.04
steps:
- name: Check out repository ✨ (non-dependabot)
if: ${{ github.actor != 'dependabot[bot]' }}
uses: actions/checkout@v4

- name: Check out repository 🎉 (dependabot)
if: ${{ github.actor == 'dependabot[bot]' }}
uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.sha }}

- name: Update apt-get 🚀
run: sudo apt-get update -qq

- name: Install dependencies (Ubuntu) 🚀
run: >-
sudo apt-get install -qq libcairo2-dev libjpeg8-dev libpango1.0-dev
libgif-dev build-essential g++ xvfb libgles2-mesa-dev libgbm-dev
libxxf86vm-dev
- name: Setup node env 📦
uses: actions/setup-node@v4
with:
node-version-file: 'package.json'
check-latest: true
cache: 'npm'

- name: Install dependencies 🚀
run: npm ci --prefer-offline --no-audit

- name: Pull test data 📦
run: >-
wget -O test_data.zip
https://github.com/maptiler/tileserver-gl/releases/download/v1.3.0/test_data.zip
- name: Prepare test data 📦
run: unzip -q test_data.zip -d test_data

- name: Run tests 🧪
run: xvfb-run --server-args="-screen 0 1024x768x24" npm test

- name: Set up QEMU
uses: docker/setup-qemu-action@v3
with:
platforms: 'arm64'

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Test Docker Build
uses: docker/build-push-action@v6
with:
context: .
push: false
platforms: linux/arm64,linux/amd64
# experimental: https://github.com/docker/build-push-action/blob/master/docs/advanced/cache.md#cache-backend-api
cache-from: type=gha
cache-to: type=gha,mode=max
43 changes: 43 additions & 0 deletions .github/workflows/pipeline.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: 'The Pipeline'

on:
push:
branches:
- master
pull_request:
branches:
- master

concurrency:
group: ci-${{ github.ref }}-1
cancel-in-progress: true

jobs:
extract-branch:
name: 'Fetch branch'
runs-on: ubuntu-latest
outputs:
current_branch: ${{ steps.get-branch.outputs.current_branch }}
steps:
- name: Extract branch name 🕊
id: get-branch
run: echo "current_branch=${GITHUB_REF##*/}" >> $GITHUB_OUTPUT
ci:
name: 'CI'
needs:
- extract-branch
uses: ./.github/workflows/ci.yml
ct:
name: 'CT'
needs:
- extract-branch
uses: ./.github/workflows/ct.yml
automerger:
name: 'Automerge Dependabot PRs'
needs:
- ci
- ct
- extract-branch
if: >
github.event_name == 'pull_request' && github.event.pull_request.user.login == 'dependabot[bot]'
uses: ./.github/workflows/automerger.yml
Loading