Skip to content

Commit

Permalink
Move output files from mapbox.* to maplibre.* (#75)
Browse files Browse the repository at this point in the history
Rename mapbox to maplibre

* Renaming `dist/mapbox.*` to `dist/maplibre.*` files.
* Rename global variable `mapboxgl` to `maplibregl`.

related #27
  • Loading branch information
Joxit authored Feb 17, 2021
1 parent e5e320f commit e60fb15
Show file tree
Hide file tree
Showing 71 changed files with 253 additions and 253 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/analyze.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,8 @@ jobs:
name: dist
path: before
repo: maplibre/maplibre-gl-js
- run: yarn source-map-explorer before/mapbox-gl.js --gzip --json before.json
- run: yarn source-map-explorer after/mapbox-gl.js --gzip --json after.json
- run: yarn source-map-explorer before/maplibre-gl.js --gzip --json before.json
- run: yarn source-map-explorer after/maplibre-gl.js --gzip --json after.json
- name: Build bundle size report
run: node build/check-bundle-size.js > comment-body.txt
- name: Dump bundle size report
Expand Down
8 changes: 4 additions & 4 deletions bench/gl-stats.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,15 @@
let now = performance.now();
window.performance.now = () => now;
</script>
<script src="../dist/mapbox-gl.js"></script>
<script src="../dist/maplibre-gl.js"></script>
<style>.mapboxgl-canary { background-color: salmon; }</style>
</head>
<body style="margin: 0; padding: 0"><div id="map" style="width: 500px; height: 500px"></div></body>
<script>
mapboxgl.accessToken = 'MAPBOX_ACCESS_TOKEN';
mapboxgl.workerCount = 1;
maplibregl.accessToken = 'MAPBOX_ACCESS_TOKEN';
maplibregl.workerCount = 1;

var map = new mapboxgl.Map({
var map = new maplibregl.Map({
container: document.getElementById('map'),
style: 'mapbox://styles/mapbox/streets-v11',
center: [-77.07842066675323, 38.890315130853566],
Expand Down
10 changes: 5 additions & 5 deletions bench/gl-stats.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@
const puppeteer = require('puppeteer');
const fs = require('fs');
const zlib = require('zlib');
const mapboxGLJSSrc = fs.readFileSync('dist/mapbox-gl.js', 'utf8');
const mapboxGLCSSSrc = fs.readFileSync('dist/mapbox-gl.css', 'utf8');
const maplibreGLJSSrc = fs.readFileSync('dist/maplibre-gl.js', 'utf8');
const maplibreGLCSSSrc = fs.readFileSync('dist/maplibre-gl.css', 'utf8');
const benchSrc = fs.readFileSync('bench/gl-stats.html', 'utf8');
const {execSync} = require('child_process');

const benchHTML = benchSrc
.replace(/<script src="..\/dist\/mapbox-gl.js"><\/script>/, `<script>${mapboxGLJSSrc}</script>`)
.replace(/<script src="..\/dist\/maplibre-gl.js"><\/script>/, `<script>${maplibreGLJSSrc}</script>`)
.replace('MAPBOX_ACCESS_TOKEN', process.env.MAPBOX_ACCESS_TOKEN);

function waitForConsole(page) {
Expand All @@ -33,8 +33,8 @@ function waitForConsole(page) {
await page.setContent(benchHTML);

const stats = JSON.parse(await waitForConsole(page));
stats["bundle_size"] = mapboxGLJSSrc.length + mapboxGLCSSSrc.length;
stats["bundle_size_gz"] = zlib.gzipSync(mapboxGLJSSrc).length + zlib.gzipSync(mapboxGLCSSSrc).length;
stats["bundle_size"] = maplibreGLJSSrc.length + maplibreGLCSSSrc.length;
stats["bundle_size_gz"] = zlib.gzipSync(maplibreGLJSSrc).length + zlib.gzipSync(maplibreGLCSSSrc).length;
stats.dt = execSync('git show --no-patch --no-notes --pretty=\'%cI\' HEAD').toString().substring(0, 19);
stats.commit = execSync('git rev-parse --short HEAD').toString().trim();
stats.message = execSync('git show -s --format=%s HEAD').toString().trim();
Expand Down
6 changes: 3 additions & 3 deletions bench/styles/benchmarks.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import mapboxgl from '../../src';
import maplibregl from '../../src';
import accessToken from '../lib/access_token';
import locationsWithTileID from '../lib/locations_with_tile_id';
import styleBenchmarkLocations from '@mapbox/gazetteer/benchmark/style-benchmark-locations.json';
Expand All @@ -13,7 +13,7 @@ import getWorkerPool from '../../src/util/global_worker_pool';

const locations = locationsWithTileID(styleBenchmarkLocations.features);

mapboxgl.accessToken = accessToken;
maplibregl.accessToken = accessToken;

const benchmarks = window.benchmarks = [];

Expand Down Expand Up @@ -44,4 +44,4 @@ Promise.resolve().then(() => {
getWorkerPool().acquire(-1);
});

export default mapboxgl;
export default maplibregl;
2 changes: 1 addition & 1 deletion bench/styles/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0">

<link href='https://www.mapbox.com/base/latest/base.css' rel='stylesheet' />
<link rel='stylesheet' href='/dist/mapbox-gl.css'/>
<link rel='stylesheet' href='/dist/maplibre-gl.css'/>
</head>

<body>
Expand Down
12 changes: 6 additions & 6 deletions bench/versions/benchmarks.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import mapboxgl from '../../src';
import maplibregl from '../../src';
import accessToken from '../lib/access_token';
import locationsWithTileID from '../lib/locations_with_tile_id';
import styleBenchmarkLocations from '@mapbox/gazetteer/benchmark/style-benchmark-locations.json';
Expand All @@ -25,15 +25,15 @@ import getWorkerPool from '../../src/util/global_worker_pool';

const styleLocations = locationsWithTileID(styleBenchmarkLocations.features);

mapboxgl.accessToken = accessToken;
maplibregl.accessToken = accessToken;

window.mapboxglBenchmarks = window.mapboxglBenchmarks || {};
window.maplibreglBenchmarks = window.maplibreglBenchmarks || {};

const version = process.env.BENCHMARK_VERSION;

function register(name, bench) {
window.mapboxglBenchmarks[name] = window.mapboxglBenchmarks[name] || {};
window.mapboxglBenchmarks[name][version] = bench;
window.maplibreglBenchmarks[name] = window.maplibreglBenchmarks[name] || {};
window.maplibreglBenchmarks[name][version] = bench;
}

const style = 'mapbox://styles/mapbox/streets-v10';
Expand Down Expand Up @@ -84,4 +84,4 @@ Promise.resolve().then(() => {
getWorkerPool().acquire(-1);
});

export default mapboxgl;
export default maplibregl;
2 changes: 1 addition & 1 deletion bench/versions/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0">

<link href='https://www.mapbox.com/base/latest/base.css' rel='stylesheet' />
<link rel='stylesheet' href='/dist/mapbox-gl.css'/>
<link rel='stylesheet' href='/dist/maplibre-gl.css'/>
<script src='https://unpkg.com/url-search-params@0.10.0/build/url-search-params.js'></script>
</head>

Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion debug/.eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
"browser": true
},
"globals": {
"mapboxgl": false,
"maplibregl": false,
"React": false,
"ReactDOM": false
}
Expand Down
6 changes: 3 additions & 3 deletions debug/2762.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<title>Mapbox GL JS debug page</title>
<meta charset='utf-8'>
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no">
<link rel='stylesheet' href='../dist/mapbox-gl.css' />
<link rel='stylesheet' href='../dist/maplibre-gl.css' />
<style>
body { margin: 0; padding: 0; }
html, body, #map { height: 100%; }
Expand All @@ -14,11 +14,11 @@
<body>
<div id='map'></div>

<script src='../dist/mapbox-gl-dev.js'></script>
<script src='../dist/maplibre-gl-dev.js'></script>
<script src='../debug/../debug/../debug/access_token_generated.js'></script>
<script>

var map = new mapboxgl.Map({
var map = new maplibregl.Map({
container: 'map',
style: {
"version": 8,
Expand Down
6 changes: 3 additions & 3 deletions debug/3895.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<title>Mapbox GL JS debug page</title>
<meta charset='utf-8'>
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no">
<link rel='stylesheet' href='../dist/mapbox-gl.css' />
<link rel='stylesheet' href='../dist/maplibre-gl.css' />
<style>
body { margin: 0; padding: 0; }
html, body, #map { height: 100%; }
Expand All @@ -14,11 +14,11 @@
<body>
<div id='map'></div>

<script src='../dist/mapbox-gl-dev.js'></script>
<script src='../dist/maplibre-gl-dev.js'></script>
<script src='../debug/access_token_generated.js'></script>
<script>

var map = window.map = new mapboxgl.Map({
var map = window.map = new maplibregl.Map({
container: 'map',
center: [-68.13734351262877, 45.137451890638886],
zoom: 5,
Expand Down
8 changes: 4 additions & 4 deletions debug/7438.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<title>Mapbox GL JS debug page</title>
<meta charset='utf-8'>
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no">
<link rel='stylesheet' href='../dist/mapbox-gl.css' />
<link rel='stylesheet' href='../dist/maplibre-gl.css' />
<style>
body { margin: 0; padding: 0; }
html, body, #map { height: 100%; }
Expand All @@ -14,11 +14,11 @@
<body>
<div id='map'></div>

<script src='../dist/mapbox-gl-dev.js'></script>
<script src='../dist/maplibre-gl-dev.js'></script>
<script src='../debug/access_token_generated.js'></script>
<script>

var map = window.map = new mapboxgl.Map({
var map = window.map = new maplibregl.Map({
container: 'map',
zoom: 12.5,
maxZoom: 24,
Expand All @@ -27,7 +27,7 @@
hash: true
});

map.addControl(new mapboxgl.ScaleControl({unit: 'nautical'}));
map.addControl(new maplibregl.ScaleControl({unit: 'nautical'}));

</script>
</body>
Expand Down
6 changes: 3 additions & 3 deletions debug/7517.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<title>Mapbox GL JS debug page</title>
<meta charset='utf-8'>
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no">
<link rel='stylesheet' href='../dist/mapbox-gl.css' />
<link rel='stylesheet' href='../dist/maplibre-gl.css' />
<style>
body {
margin: 0;
Expand All @@ -23,7 +23,7 @@
<body>
<div id='map'></div>

<script src='../dist/mapbox-gl-dev.js'></script>
<script src='../dist/maplibre-gl-dev.js'></script>
<script src='../debug/access_token_generated.js'></script>
<script>
const data = {
Expand Down Expand Up @@ -79,7 +79,7 @@
}
};

const map = new mapboxgl.Map({
const map = new maplibregl.Map({
container: 'map',
style: 'mapbox://styles/mapbox/streets-v9',
center: [-68.13734351262877, 45.137451890638886],
Expand Down
2 changes: 1 addition & 1 deletion debug/access_token.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
'use strict';

mapboxgl.accessToken = getAccessToken();
maplibregl.accessToken = getAccessToken();

function getAccessToken() {
var accessToken = (
Expand Down
6 changes: 3 additions & 3 deletions debug/animate.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<title>Mapbox GL JS debug page</title>
<meta charset='utf-8'>
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no">
<link rel='stylesheet' href='../dist/mapbox-gl.css' />
<link rel='stylesheet' href='../dist/maplibre-gl.css' />
<style>
#map { width: 1200px; height: 800px; }
</style>
Expand All @@ -13,11 +13,11 @@
<body>
<div id='map'></div>

<script src='../dist/mapbox-gl-dev.js'></script>
<script src='../dist/maplibre-gl-dev.js'></script>
<script src='../debug/access_token_generated.js'></script>
<script>

var map = window.map = new mapboxgl.Map({
var map = window.map = new maplibregl.Map({
container: 'map',
style: 'mapbox://styles/mapbox/streets-v11',
center: [0, 0],
Expand Down
6 changes: 3 additions & 3 deletions debug/bounds.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<title>Mapbox GL JS debug page</title>
<meta charset='utf-8'>
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no">
<link rel='stylesheet' href='../dist/mapbox-gl.css' />
<link rel='stylesheet' href='../dist/maplibre-gl.css' />
<style>
body { margin: 0; padding: 0; }
html, body, #map { height: 100%; }
Expand All @@ -14,10 +14,10 @@
<body>
<div id='map'></div>

<script src='../dist/mapbox-gl-dev.js'></script>
<script src='../dist/maplibre-gl-dev.js'></script>
<script src='../debug/access_token_generated.js'></script>
<script>
var map = window.map = new mapboxgl.Map({
var map = window.map = new maplibregl.Map({
container: 'map',
zoom: 12.5,
center: [-77.01866, 38.888],
Expand Down
10 changes: 5 additions & 5 deletions debug/cache_api.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<title>Mapbox GL JS debug page</title>
<meta charset='utf-8'>
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no">
<link rel='stylesheet' href='../dist/mapbox-gl.css' />
<link rel='stylesheet' href='../dist/maplibre-gl.css' />
<style>
body { margin: 0; padding: 0; }
html, body, #map { width: 500px; height: 500px; }
Expand All @@ -17,7 +17,7 @@
</div>
<div id='map'></div>

<script src='../dist/mapbox-gl-dev.js'></script>
<script src='../dist/maplibre-gl-dev.js'></script>
<script src='../debug/access_token_generated.js'></script>
<script>

Expand Down Expand Up @@ -86,7 +86,7 @@
}

function storageClearedTest(callback) {
mapboxgl.clearStorage(function() {
maplibregl.clearStorage(function() {
const message = 'Clears cache storage.';
caches.open(CACHE_NAME).catch(catchError).then(cache_ => {
cache = cache_;
Expand All @@ -100,7 +100,7 @@

function initialize(zoom, onLoad) {
if (map) map.remove();
map = window.map = new mapboxgl.Map({
map = window.map = new maplibregl.Map({
container: 'map',
zoom,
center: [-77.01866, 38.888],
Expand Down Expand Up @@ -252,7 +252,7 @@

function initializeRaster(done) {
if (map) map.remove();
map = new mapboxgl.Map({
map = new maplibregl.Map({
container: 'map',
zoom: 0,
center: [137.9150899566626, 36.25956997955441],
Expand Down
6 changes: 3 additions & 3 deletions debug/canvas.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<title>Mapbox GL JS debug page</title>
<meta charset='utf-8'>
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no">
<link rel='stylesheet' href='../dist/mapbox-gl.css' />
<link rel='stylesheet' href='../dist/maplibre-gl.css' />
<style>
body { margin: 0; padding: 0; }
html, body, #map { height: 100%; }
Expand All @@ -17,7 +17,7 @@
Canvas not supported
</canvas>
<div id='map'></div>
<script src='../dist/mapbox-gl-dev.js'></script>
<script src='../dist/maplibre-gl-dev.js'></script>
<script src='../debug/access_token_generated.js'></script>
<script>

Expand Down Expand Up @@ -62,7 +62,7 @@
}]
};

var map = new mapboxgl.Map({
var map = new maplibregl.Map({
container: 'map',
minZoom: 14,
zoom: 17,
Expand Down
Loading

0 comments on commit e60fb15

Please sign in to comment.