Skip to content

Commit

Permalink
Merge pull request #6 from mug-jp/chores
Browse files Browse the repository at this point in the history
Chores: update maplibre-gl to v5, add unittest
  • Loading branch information
Kanahiro authored Jan 3, 2025
2 parents ffb4e98 + 4125bd1 commit 64f6647
Show file tree
Hide file tree
Showing 7 changed files with 1,570 additions and 21 deletions.
41 changes: 41 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: test

on:
pull_request:
branches:
- master
paths:
- 'src/**'
- 'example/**'
workflow_dispatch:

jobs:
test:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v2

- name: setup node
uses: actions/setup-node@v1
with:
node-version: '22.x'

- name: install pnpm
run: npm install -g pnpm

- name: install
run: pnpm install

- name: build
run: pnpm build:pkg

- name: install playwright
run: pnpm exec playwright install

- name: unittest
run: pnpm test

- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v5
with:
token: ${{ secrets.CODECOV_TOKEN }}
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,6 @@ example/raster.bundle.js
example/raster.bundle.js.LICENSE.txt
example/vector.bundle.js
example/vector.bundle.js.LICENSE.txt
build
build
__screenshots__
coverage
2 changes: 1 addition & 1 deletion example/raster.ts
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ const map = new maplibregl.Map({
bearing: -18,
maxPitch: 85,
pitch: 60,
zoom: 2,
zoom: 8,
minZoom: 5,
maxZoom: 10,
});
Expand Down
10 changes: 7 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"version": "1.2.0",
"description": "Temporal Control plugin for Maplibre GL JS",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1",
"test": "vitest src --coverage --coverage.provider=v8",
"build": "vite build -c vite.config.example.ts",
"build:pkg": "vite build && tsc",
"prepare": "npm run build:pkg",
Expand All @@ -21,11 +21,15 @@
},
"homepage": "https://github.com/mug-jp/maplibre-gl-temporal-controller#readme",
"devDependencies": {
"@vitest/browser": "^2.1.8",
"@vitest/coverage-v8": "^2.1.8",
"jma-utils": "^0.1.0",
"maplibre-gl": "5.0.0-pre.10",
"maplibre-gl": "^5.0.0",
"playwright": "^1.49.1",
"rollup-plugin-visualizer": "^5.13.1",
"typescript": "^4.9.5",
"vite": "^6.0.6"
"vite": "^6.0.6",
"vitest": "^2.1.8"
},
"main": "./build/index.umd.cjs",
"module": "./build/index.js",
Expand Down
Loading

0 comments on commit 64f6647

Please sign in to comment.