Skip to content

Commit aca8fa0

Browse files
committed
tasks: hard code mapbox access token in constants.js
- no need to hide mapbox access tokens (there are public) - remove `export MAPBOX_ACCESS_TOKEN` step in contributing guide
1 parent 5e04f37 commit aca8fa0

File tree

3 files changed

+5
-16
lines changed

3 files changed

+5
-16
lines changed

CONTRIBUTING.md

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -38,26 +38,21 @@ We use the following [labels](https://github.com/plotly/plotly.js/labels) to tra
3838

3939
#### Step 1: Clone the plotly.js repo and install its dependencies
4040

41-
```
41+
```bash
4242
git clone https://github.com/plotly/plotly.js.git
4343
cd plotly.js
4444
npm install
4545
```
4646

47-
#### Step 2: Setup Mapbox access token
48-
49-
As of `v1.13.0`, plotly.js includes a [`mapbox-gl`](https://github.com/mapbox/mapbox-gl-js) integration. Creating `mapbox-gl` graphs requires an
50-
[`accessToken`](https://www.mapbox.com/help/define-access-token/). To make sure
51-
that the plotly.js test suites and devtools work properly, locate your Mapbox access
52-
token and run:
47+
#### Step 2: Setup test environment
5348

5449
```bash
55-
export MAPBOX_ACCESS_TOKEN="<your access token>" && npm run pretest
50+
npm run pretest
5651
```
5752

5853
#### Step 3: Start the test dashboard
5954

60-
```
55+
```bash
6156
npm start
6257
```
6358

tasks/pretest.js

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,7 @@
11
var fs = require('fs');
22
var constants = require('./util/constants');
3-
var mapboxAccessToken = process.env.MAPBOX_ACCESS_TOKEN;
43

54

6-
if(!mapboxAccessToken) {
7-
throw new Error([
8-
'MAPBOX_ACCESS_TOKEN not found!!!',
9-
'Please export your mapbox access token into and try again.'
10-
].join('\n'));
11-
}
125

136
// Create a credentials json file,
147
// to be required in jasmine test suites and test dashboard

tasks/util/constants.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,7 @@ module.exports = {
6767
pathToJasmineTests: path.join(pathToRoot, 'test/jasmine/tests'),
6868
pathToJasmineBundleTests: path.join(pathToRoot, 'test/jasmine/bundle_tests'),
6969

70+
mapboxAccessToken: 'pk.eyJ1IjoiZXRwaW5hcmQiLCJhIjoiY2luMHIzdHE0MGFxNXVubTRxczZ2YmUxaCJ9.hwWZful0U2CQxit4ItNsiQ',
7071
pathToCredentials: path.join(pathToBuild, 'credentials.json'),
7172
pathToSetPlotConfig: path.join(pathToBuild, 'set_plot_config.js'),
7273

0 commit comments

Comments
 (0)