Skip to content

Commit fb55448

Browse files
stepankuzmingithub-actions[bot]
authored andcommitted
Refactor bundlers test suite
GitOrigin-RevId: 4e07563e7f5c4e73427ae68010712d947e42b585
1 parent 1a28fb7 commit fb55448

42 files changed

Lines changed: 484 additions & 243 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/ci.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,7 @@ jobs:
5151
- run: npm run test-build
5252
- run: xvfb-run -a npm run test-esm
5353
- run: xvfb-run -a npm run test-csp
54-
- run: xvfb-run -a npm test -w vite-build-test
55-
- run: xvfb-run -a npm test -w webpack-build-test
54+
- run: xvfb-run -a npm run test-bundlers
5655
- run: npm run test -w typescript-build-test
5756
- run: npm run build -w @mapbox/mapbox-gl-pmtiles-provider
5857
- run: npm run size

.gitignore

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,7 @@ tests-to-run.txt
3636
**/test/integration/**/test-results.xml
3737
**/test/integration/dist/**/*.js
3838
**/test/integration/dist/**/*.json
39-
**/test/build/vite/dist/dist/*
40-
**/test/build/webpack/dist/*
41-
test/build/*.tgz
39+
test/*.tgz
4240
.eslintcache
4341
src/style-spec/dist/index.cjs
4442
src/style-spec/dist/index.d.ts

debug/pmtiles-umd.html

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
<!DOCTYPE html>
2+
<html>
3+
<head>
4+
<title>Mapbox GL JS debug page</title>
5+
<meta charset="utf-8">
6+
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no">
7+
<link rel="stylesheet" href="../dist/mapbox-gl.css" />
8+
<style>
9+
body { margin: 0; padding: 0; }
10+
html, body, #map { height: 100%; }
11+
</style>
12+
</head>
13+
<body>
14+
<div id="map"></div>
15+
<script src="../dist/mapbox-gl-dev.js"></script>
16+
<script type="module">
17+
import {getAccessToken} from './access_token_generated.js';
18+
19+
mapboxgl.addTileProvider('pmtiles', new URL('../plugins/mapbox-gl-pmtiles-provider/dist/mapbox-gl-pmtiles-provider.js', window.location.href).href);
20+
21+
const map = window.map = new mapboxgl.Map({
22+
accessToken: getAccessToken(),
23+
container: 'map',
24+
style: 'mapbox://styles/mapbox/standard',
25+
zoom: 1.78,
26+
center: [-103.64548, 51.14245]
27+
});
28+
29+
map.on('load', () => {
30+
map.addSource('pmtiles-earthquakes', {
31+
type: 'vector',
32+
url: 'https://docs.mapbox.com/mapbox-gl-js/assets/earthquakes.pmtiles'
33+
});
34+
35+
map.addLayer({
36+
id: 'pmtiles-vector-layer',
37+
type: 'circle',
38+
source: 'pmtiles-earthquakes',
39+
'source-layer': 'earthquakes',
40+
paint: {
41+
'circle-color': 'transparent',
42+
'circle-stroke-color': 'teal',
43+
'circle-stroke-width': 0.5,
44+
'circle-radius': 3,
45+
'circle-emissive-strength': 1
46+
}
47+
});
48+
});
49+
</script>
50+
</body>
51+
</html>

eslint.config.js

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -66,9 +66,7 @@ const IGNORED_PATHS = [
6666
'./test/integration/tiles/**/*',
6767
'./test/integration/tilesets/**/*',
6868
'./test/integration/lib/operation-handlers.js',
69-
'./test/build/{vite,webpack}/**/*',
70-
'./test/build/scenarios/**/*',
71-
'./test/build/browser-check.cjs',
69+
'./test/bundlers/*/**',
7270
'./test/build/typings/**/*',
7371
'./test/build/style-spec.test.js',
7472
];

package-lock.json

Lines changed: 71 additions & 10 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,7 @@
2727
"workspaces": [
2828
"src/style-spec",
2929
"plugins/mapbox-gl-pmtiles-provider",
30-
"test/build/vite",
31-
"test/build/webpack",
30+
"test/bundlers/*",
3231
"test/build/typings"
3332
],
3433
"devDependencies": {
@@ -134,6 +133,8 @@
134133
"test-usvg": "vitest --config vitest.config.usvg.ts --run",
135134
"start-usvg": "esbuild src/data/usvg/usvg_pb_renderer.ts src/data/usvg/usvg_pb_decoder.ts --outdir=src/data/usvg/ --bundle --format=esm --watch --serve=9966 --servedir=.",
136135
"test-build": "node --test --test-timeout 10000 test/build/*.test.js",
136+
"pretest-bundlers": "./test/bundlers/pretest.sh",
137+
"test-bundlers": "vitest run --config vitest.config.bundlers.ts",
137138
"test-esm": "npx vitest run --config vitest.config.esm.ts",
138139
"test-csp": "npm run build-token && vitest --config vitest.config.csp.ts --run",
139140
"watch-render": "npx vitest watch --config vitest.config.render.ts",

test/build/browser-check.cjs

Lines changed: 0 additions & 60 deletions
This file was deleted.

test/build/scenarios/pmtiles-esm.js

Lines changed: 0 additions & 13 deletions
This file was deleted.

test/build/scenarios/pmtiles-umd.js

Lines changed: 0 additions & 13 deletions
This file was deleted.

test/build/typings/pretest.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
set -e
33

44
DEST="$(cd "$(dirname "$0")" && pwd)"
5-
TARBALL_DIR="$DEST/.."
5+
TARBALL_DIR="$DEST/../.."
66

77
"$TARBALL_DIR/pack.sh"
88

0 commit comments

Comments
 (0)