Skip to content

Commit 8343bae

Browse files
authored
Merge branch 'master' into prevent-mobile-panning
2 parents 2a61d92 + d30a3bd commit 8343bae

File tree

98 files changed

+15533
-7398
lines changed

Some content is hidden

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

98 files changed

+15533
-7398
lines changed

.circleci/config.yml

+128
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,128 @@
1+
version: 2.0
2+
3+
# Inspired by:
4+
# https://github.com/CircleCI-Public/circleci-demo-workflows/blob/workspace-forwarding/.circleci/config.yml
5+
# https://circleci.com/docs/2.0/workflows/#using-workspaces-to-share-data-among-jobs
6+
#
7+
# For list of official CircleCI node.js images, go to:
8+
# https://hub.docker.com/r/circleci/node/tags/
9+
10+
jobs:
11+
build:
12+
docker:
13+
- image: circleci/node:8.9.4
14+
working_directory: ~/plotly.js
15+
steps:
16+
- checkout
17+
- restore_cache:
18+
keys:
19+
- v{{ .Environment.CIRCLE_CACHE_VERSION }}-deps-{{ .Branch }}-{{ checksum "package-lock.json" }}
20+
- v{{ .Environment.CIRCLE_CACHE_VERSION }}-deps-master-{{ checksum "package-lock.json" }}
21+
- run:
22+
name: Install dependencies
23+
command: |
24+
npm install
25+
- run:
26+
name: List dependency versions
27+
command: |
28+
echo "npm: $(npm --version)"
29+
echo "node: $(node --version)"
30+
npm ls || true
31+
- run:
32+
name: Pretest
33+
command: |
34+
npm run pretest
35+
npm run cibuild
36+
- save_cache:
37+
paths:
38+
- node_modules
39+
key: v{{ .Environment.CIRCLE_CACHE_VERSION }}-deps-{{ .Branch }}-{{ checksum "package.json" }}
40+
- persist_to_workspace:
41+
root: .
42+
paths:
43+
- node_modules
44+
- build
45+
- dist
46+
47+
test-jasmine:
48+
docker:
49+
# need '-browsers' version to test in real (xvfb-wrapped) browsers
50+
- image: circleci/node:8.9.4-browsers
51+
working_directory: ~/plotly.js
52+
steps:
53+
- checkout
54+
- attach_workspace:
55+
at: ~/plotly.js
56+
- run:
57+
name: Set timezone to Alaska time (arbitrary timezone to test date logic)
58+
command: |
59+
sudo cp /usr/share/zoneinfo/America/Anchorage /etc/localtime
60+
- run:
61+
name: Run jasmine tests (batch 1)
62+
command: ./.circleci/test.sh jasmine
63+
64+
test-jasmine2:
65+
docker:
66+
# need '-browsers' version to test in real (xvfb-wrapped) browsers
67+
- image: circleci/node:8.9.4-browsers
68+
working_directory: ~/plotly.js
69+
steps:
70+
- checkout
71+
- attach_workspace:
72+
at: ~/plotly.js
73+
- run:
74+
name: Set timezone to Alaska time (arbitrary timezone to test date logic)
75+
command: |
76+
sudo cp /usr/share/zoneinfo/America/Anchorage /etc/localtime
77+
- run:
78+
name: Run jasmine tests (batch 2)
79+
command: ./.circleci/test.sh jasmine2
80+
81+
test-image:
82+
docker:
83+
- image: plotly/testbed:latest
84+
working_directory: /var/www/streambed/image_server/plotly.js/
85+
steps:
86+
- checkout
87+
- attach_workspace:
88+
at: /var/www/streambed/image_server/plotly.js/
89+
- run:
90+
name: Run and setup container
91+
command: |
92+
supervisord &
93+
npm run docker -- setup
94+
- run:
95+
name: Run image tests
96+
command: ./.circleci/test.sh image
97+
- store_artifacts:
98+
path: build
99+
100+
test-syntax:
101+
docker:
102+
- image: circleci/node:8.9.4
103+
working_directory: ~/plotly.js
104+
steps:
105+
- checkout
106+
- attach_workspace:
107+
at: ~/plotly.js
108+
- run:
109+
name: Run syntax tests
110+
command: ./.circleci/test.sh syntax
111+
112+
workflows:
113+
version: 2
114+
build-and-test:
115+
jobs:
116+
- build
117+
- test-jasmine:
118+
requires:
119+
- build
120+
- test-jasmine2:
121+
requires:
122+
- build
123+
- test-image:
124+
requires:
125+
- build
126+
- test-syntax:
127+
requires:
128+
- build

.circleci/test.sh

+35
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
#!/bin/bash
2+
3+
# override CircleCi's default run settings
4+
set +e
5+
set +o pipefail
6+
7+
EXIT_STATE=0
8+
9+
case $1 in
10+
11+
jasmine)
12+
npm run test-jasmine -- --skip-tags=gl,noCI || EXIT_STATE=$?
13+
exit $EXIT_STATE
14+
;;
15+
16+
jasmine2)
17+
npm run test-jasmine -- --tags=gl --skip-tags=noCI || EXIT_STATE=$?
18+
npm run test-bundle || EXIT_STATE=$?
19+
exit $EXIT_STATE
20+
;;
21+
22+
image)
23+
npm run test-image || EXIT_STATE=$?
24+
npm run test-export || EXIT_STATE=$?
25+
npm run test-image-gl2d || EXIT_STATE=$?
26+
exit $EXIT_STATE
27+
;;
28+
29+
syntax)
30+
npm run lint || EXIT_STATE=$?
31+
npm run test-syntax || EXIT_STATE=$?
32+
exit $EXIT_STATE
33+
;;
34+
35+
esac

.eslintrc

+5-3
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,8 @@
2323
"no-trailing-spaces": [2],
2424
"no-multiple-empty-lines": [2, {"max": 2, "maxEOF": 0}],
2525
"eol-last": [2],
26-
"indent": [2, 4, {"SwitchCase": 1}],
26+
"indent": [0],
27+
"indent-legacy": [2, 4, {"SwitchCase": 1}],
2728
"max-len": [0, 80],
2829
"brace-style": [0, "stroustrup", {"allowSingleLine": true}],
2930
"curly": [2, "multi-line"],
@@ -46,7 +47,7 @@
4647
"space-before-blocks": [2],
4748
"spaced-comment": [2, "always"],
4849
"no-tabs": [2],
49-
"no-multi-spaces": [2],
50+
"no-multi-spaces": [2, {"ignoreEOLComments": true}],
5051
"no-whitespace-before-property": [2],
5152
"no-unexpected-multiline": [2],
5253
"no-floating-decimal": [2],
@@ -65,6 +66,7 @@
6566
"no-use-before-define": [2, "nofunc"],
6667
"no-loop-func": [2],
6768
"no-console": [0],
68-
"no-unused-labels": [2]
69+
"no-unused-labels": [2],
70+
"no-useless-escape": [0]
6971
}
7072
}

.github/PULL_REQUEST_TEMPLATE.md

+2-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,8 @@ Developers are strongly encouraged to first make a PR to their own plotly.js for
1515
Before opening a pull request, developer should:
1616

1717
- `git rebase` their local branch off the latest `master`,
18-
- make sure to **not** `git add` the `dist/` folder (the `dist/` is updated only on verion bumps),
18+
- make sure to **not** `git add` the `dist/` folder (the `dist/` is updated only on version bumps),
19+
- make sure to commit changes to the `package-lock.json` file (if any),
1920
- write an overview of what the PR attempts to do,
2021
- select the _Allow edits from maintainers_ option (see this [article](https://help.github.com/articles/allowing-changes-to-a-pull-request-branch-created-from-a-fork/) for more details).
2122

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ npm-debug.log*
99
*.sublime*
1010

1111
.*
12+
!.circleci
1213
!.gitignore
1314
!.npmignore
1415
!.eslintrc

CONTRIBUTING.md

+11-6
Original file line numberDiff line numberDiff line change
@@ -24,19 +24,24 @@ We use the following [labels](https://github.com/plotly/plotly.js/labels) to tra
2424
| `type: community` | issue left open for community input and pull requests |
2525
| `type: duplicate` | *self-explanatory* |
2626
| `type: wontfix` | *self-explanatory* |
27-
| `status: discussion needed` | Issue or PR that required discussion among maintaners before moving forward |
28-
| `status: in progress` | PRs that required some intial feedback but not ready to merge |
27+
| `status: discussion needed` | Issue or PR that required discussion among maintainers before moving forward |
28+
| `status: in progress` | PRs that required some initial feedback but not ready to merge |
2929
| `status: reviewable` | PRs that are completed from the author's perspective |
3030
| `status: on hold` | PRs that are put on hold |
3131

3232
## Development
3333

34-
#### Perequisites
34+
#### Prerequisites
3535

3636
- git
37-
- [node.js](https://nodejs.org/en/). We recommend using node.js v6.x or v4.x (both LTS).
38-
Upgrading and managing node versions can be easily done using
39-
[`nvm`](https://github.com/creationix/nvm) or its Windows alternatives.
37+
- [node.js](https://nodejs.org/en/). We recommend using node.js v8.x, but all
38+
versions starting from v4 should work. Upgrading and managing node versions
39+
can be easily done using [`nvm`](https://github.com/creationix/nvm) or its
40+
Windows alternatives.
41+
- [`npm`](https://www.npmjs.com/) v5.x and up (which ships by default with
42+
node.js v8.x) to ensure that the
43+
[`package-lock.json`](https://docs.npmjs.com/files/package-lock.json) file is
44+
used and updated correctly.
4045

4146
#### Step 1: Clone the plotly.js repo and install its dependencies
4247

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ A repo that demonstrates how to build plotly.js with Webpack can be found [here]
111111
```js
112112
...
113113
module: {
114-
loaders: [
114+
rules: [
115115
{
116116
test: /\.js$/,
117117
loader: 'ify-loader'

circle.yml

-27
This file was deleted.

0 commit comments

Comments
 (0)