Skip to content

Commit

Permalink
Tidy up & clarify directory structure (#4215)
Browse files Browse the repository at this point in the history
* Merge LICENSE files

* Rename "interfaces" to "flow-interfaces"

* Rename "js" to "src"

* Move "shaders" to "src/shaders"

* Rename "test/js" to "test/unit"

* Rename "ci" to "ci-scripts"

* Move "global_worker_pool" to "src/util"

* Merge "src/lib/debugtext.js" into "src/render/draw_debug.js"

* Rename "src/mapbox-gl.js" to "src/index.js"
  • Loading branch information
lucaswoj authored Feb 7, 2017
1 parent 205978b commit b9e10b9
Show file tree
Hide file tree
Showing 387 changed files with 411 additions and 428 deletions.
4 changes: 2 additions & 2 deletions .flowconfig
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@
.*/node_modules/jsonlint/.*
.*/node_modules/jsonlint-lines-primitives/.*
.*/node_modules/unflowify/.*
.*/test/js/style-spec/fixture/invalidjson.input.json
.*/test/unit/style-spec/fixture/invalidjson.input.json

[include]

[libs]

./interfaces/
./flow-interfaces/

[options]

Expand Down
47 changes: 0 additions & 47 deletions LICENSE

This file was deleted.

32 changes: 32 additions & 0 deletions LICENSE.txt
Original file line number Diff line number Diff line change
Expand Up @@ -79,3 +79,35 @@ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.

--------------------------------------------------------------------------------

Contains a portion of d3-color https://github.com/d3/d3-color

Copyright 2010-2016 Mike Bostock
All rights reserved.

Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:

* Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.

* Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.

* Neither the name of the author nor the names of contributors may be used to
endorse or promote products derived from this software without specific prior
written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
2 changes: 1 addition & 1 deletion bench/benchmarks.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,4 @@ registerBenchmark('geojson-setdata-large', require('./benchmarks/geojson_setdata

// Ensure the global worker pool is never drained. Browsers have resource limits
// on the max number of workers that can be created per page.
require('../js/global_worker_pool')().acquire(-1);
require('../src/util/global_worker_pool')().acquire(-1);
16 changes: 8 additions & 8 deletions bench/benchmarks/buffer.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,17 @@ const VT = require('vector-tile');
const Protobuf = require('pbf');
const assert = require('assert');

const WorkerTile = require('../../js/source/worker_tile');
const ajax = require('../../js/util/ajax');
const Style = require('../../js/style/style');
const StyleLayerIndex = require('../../js/style/style_layer_index');
const util = require('../../js/util/util');
const Evented = require('../../js/util/evented');
const config = require('../../js/util/config');
const WorkerTile = require('../../src/source/worker_tile');
const ajax = require('../../src/util/ajax');
const Style = require('../../src/style/style');
const StyleLayerIndex = require('../../src/style/style_layer_index');
const util = require('../../src/util/util');
const Evented = require('../../src/util/evented');
const config = require('../../src/util/config');
const coordinates = require('../lib/coordinates');
const formatNumber = require('../lib/format_number');
const accessToken = require('../lib/access_token');
const deref = require('../../js/style-spec/deref');
const deref = require('../../src/style-spec/deref');

const SAMPLE_COUNT = 10;

Expand Down
2 changes: 1 addition & 1 deletion bench/benchmarks/fps.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
'use strict';

const Evented = require('../../js/util/evented');
const Evented = require('../../src/util/evented');
const formatNumber = require('../lib/format_number');
const measureFramerate = require('../lib/measure_framerate');
const createMap = require('../lib/create_map');
Expand Down
2 changes: 1 addition & 1 deletion bench/benchmarks/frame_duration.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
'use strict';

const Evented = require('../../js/util/evented');
const Evented = require('../../src/util/evented');
const formatNumber = require('../lib/format_number');
const createMap = require('../lib/create_map');

Expand Down
4 changes: 2 additions & 2 deletions bench/benchmarks/geojson_setdata_large.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
'use strict';

const Evented = require('../../js/util/evented');
const Evented = require('../../src/util/evented');
const formatNumber = require('../lib/format_number');
const setDataPerf = require('../lib/set_data_perf');
const setupGeoJSONMap = require('../lib/setup_geojson_map');
const createMap = require('../lib/create_map');
const ajax = require('../../js/util/ajax');
const ajax = require('../../src/util/ajax');

module.exports = function() {
const evented = new Evented();
Expand Down
2 changes: 1 addition & 1 deletion bench/benchmarks/geojson_setdata_small.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
'use strict';

const Evented = require('../../js/util/evented');
const Evented = require('../../src/util/evented');
const formatNumber = require('../lib/format_number');
const setDataPerf = require('../lib/set_data_perf');
const setupGeoJSONMap = require('../lib/setup_geojson_map');
Expand Down
2 changes: 1 addition & 1 deletion bench/benchmarks/map_load.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
'use strict';

const Evented = require('../../js/util/evented');
const Evented = require('../../src/util/evented');
const formatNumber = require('../lib/format_number');
const createMap = require('../lib/create_map');

Expand Down
2 changes: 1 addition & 1 deletion bench/benchmarks/query_box.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
'use strict';

const Evented = require('../../js/util/evented');
const Evented = require('../../src/util/evented');
const createMap = require('../lib/create_map');

const width = 1024;
Expand Down
2 changes: 1 addition & 1 deletion bench/benchmarks/query_point.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
'use strict';

const Evented = require('../../js/util/evented');
const Evented = require('../../src/util/evented');
const createMap = require('../lib/create_map');

const width = 1024;
Expand Down
8 changes: 4 additions & 4 deletions bench/benchmarks/style_load.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
'use strict';

const Evented = require('../../js/util/evented');
const ajax = require('../../js/util/ajax');
const config = require('../../js/util/config');
const Style = require('../../js/style/style');
const Evented = require('../../src/util/evented');
const ajax = require('../../src/util/ajax');
const config = require('../../src/util/config');
const Style = require('../../src/style/style');
const formatNumber = require('../lib/format_number');
const accessToken = require('../lib/access_token');

Expand Down
2 changes: 1 addition & 1 deletion bench/lib/coordinates.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
// This file contains the set of coordinates of tiles used in a "flyTo" from
// the Mapbox SF office to the Mapbox DC office.

const Coordinate = require('../../js/geo/coordinate');
const Coordinate = require('../../src/geo/coordinate');

module.exports = [
new Coordinate(5242, 12665, 15),
Expand Down
4 changes: 2 additions & 2 deletions bench/lib/create_map.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
'use strict';

const util = require('../../js/util/util');
const mapboxgl = require('../../js/mapbox-gl');
const util = require('../../src/util/util');
const mapboxgl = require('../../src');

module.exports = function createMap(options) {
options = util.extend({width: 512, height: 512}, options);
Expand Down
4 changes: 2 additions & 2 deletions bench/unit/bench_transform.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
const Benchmark = require('benchmark');
const suite = new Benchmark.Suite();

const Transform = require('../../js/geo/transform');
const LngLat = require('../../js/geo/lng_lat.js');
const Transform = require('../../src/geo/transform');
const LngLat = require('../../src/geo/lng_lat.js');
const Point = require('point-geometry');

const t = new Transform();
Expand Down
2 changes: 1 addition & 1 deletion bench/unit/feature_filter/bench.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
const VectorTile = require('vector-tile').VectorTile;
const Pbf = require('pbf');
const fs = require('fs');
const createFilter = require('../../../js/style-spec').featureFilter;
const createFilter = require('../../../src/style-spec').featureFilter;
const filters = require('./filters.json');
const path = require('path');

Expand Down
2 changes: 1 addition & 1 deletion bench/unit/feature_filter/big.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
'use strict';

const filter = require('../../../js/style-spec').featureFilter;
const filter = require('../../../src/style-spec').featureFilter;

const N = 64000;

Expand Down
2 changes: 1 addition & 1 deletion bench/unit/function/profile.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
'use strict';

const createFunction = require('../../../js/style-spec').function.interpolated;
const createFunction = require('../../../src/style-spec').function.interpolated;

function buildExponentialFunction(stopsCount) {
// Build an exponential function with a long list of stops
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
6 changes: 3 additions & 3 deletions circle.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,15 @@ dependencies:
- './nvm'
- '~/.yarn'
override:
- ./ci/dependencies.sh
- ./ci-scripts/dependencies.sh
test:
override:
- ./ci/test.sh
- ./ci-scripts/test.sh
deployment:
release:
tag: /v[0-9]+\.[0-9]+\.[0-9]+(\-dev)?/
commands:
- ./ci/deploy.sh
- ./ci-scripts/deploy.sh
general:
artifacts:
- "node_modules/mapbox-gl-test-suite/render-tests/index.html"
Expand Down
2 changes: 1 addition & 1 deletion docs/_layouts/default.html
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@
<link href='{% if site.mapboxjsbase %}{{site.mapboxjsbase}}{% else %}https://api.tiles.mapbox.com/mapbox.js/{% if site.mapboxjs %}{{site.mapboxjs}}{% else %}v1.6.5{% endif %}{% endif %}/mapbox.css' rel='stylesheet' />
{% endunless %}

<!--[if lt IE 9 ]><script src='{{site.url}}/js/redirect-ie.js'></script><![endif]-->
<!--[if lt IE 9 ]><script src='{{site.url}}/src/redirect-ie.js'></script><![endif]-->
<script src='https://js.stripe.com/v2/'></script>
<script>
var KM_COOKIE_DOMAIN = 'www.mapbox.com';
Expand Down
2 changes: 1 addition & 1 deletion docs/_layouts/pages.html
Original file line number Diff line number Diff line change
Expand Up @@ -98,4 +98,4 @@ <h3 class='heading'>{{example.name}}</h3>
</div>
</div>

<script src='{{site.baseurl}}/js/site.js'></script>
<script src='{{site.baseurl}}/src/site.js'></script>
2 changes: 1 addition & 1 deletion docs/_theme/index.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -198,6 +198,6 @@ var map = new mapboxgl.Map({

<link href='{{site.url}}/css/docs.css' rel='stylesheet' />
<link href='{{site.baseurl}}/site.css' rel='stylesheet' />
<script src='{{site.baseurl}}/js/site.js'></script>
<script src='{{site.baseurl}}/src/site.js'></script>
<script src='{{site.baseurl}}/api/assets/anchor.js'></script>
<script src='{{site.baseurl}}/api/assets/site.js'></script>
2 changes: 1 addition & 1 deletion docs/assets/prettify.js
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ window['PR_SHOULD_USE_CONTINUATION'] = true;
/**
* A set of tokens that can precede a regular expression literal in
* javascript
* http://web.archive.org/web/20070717142515/http://www.mozilla.org/js/language/js20/rationale/syntax.html
* http://web.archive.org/web/20070717142515/http://www.mozilla.org/src/language/js20/rationale/syntax.html
* has the full list, but I've removed ones that might be problematic when
* seen in languages that don't support regular expression literals.
*
Expand Down
2 changes: 1 addition & 1 deletion docs/js/site.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
function load() {
ZeroClipboard.config({
swfPath: window.location.origin + '/mapbox-gl-js/js/ZeroClipboard.swf',
swfPath: window.location.origin + '/mapbox-gl-js/src/ZeroClipboard.swf',
forceHandCursor: true
});

Expand Down
2 changes: 1 addition & 1 deletion docs/roadmap/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -62,4 +62,4 @@ <h2 style="margin-bottom: 0">{{r.term}}</h2>
</div>
</div>

<script src='{{site.baseurl}}/js/site.js'></script>
<script src='{{site.baseurl}}/src/site.js'></script>
2 changes: 1 addition & 1 deletion docs/style-spec/_generate/generate.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

var fs = require('fs');
var path = require('path');
var ref = require('../../../js/style-spec/reference/latest');
var ref = require('../../../src/style-spec/reference/latest');
var _ = require('lodash');
var remark = require('remark');
var html = require('remark-html');
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
57 changes: 0 additions & 57 deletions js/render/draw_debug.js

This file was deleted.

Loading

0 comments on commit b9e10b9

Please sign in to comment.