Skip to content

Commit 0c5fa1d

Browse files
committed
Merge develop
2 parents c3445dc + ce7a85d commit 0c5fa1d

File tree

355 files changed

+53207
-17512
lines changed

Some content is hidden

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

355 files changed

+53207
-17512
lines changed

.babelrc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
"env": {
77
"production": {
88
"plugins": [
9+
"babel-plugin-styled-components",
910
"transform-react-remove-prop-types",
1011
"@babel/plugin-transform-react-constant-elements",
1112
"@babel/plugin-transform-react-inline-elements",
@@ -48,6 +49,7 @@
4849
},
4950
"development": {
5051
"plugins": [
52+
"babel-plugin-styled-components",
5153
"react-hot-loader/babel"
5254
]
5355
}

.env.example

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
1-
API_URL=/api
1+
API_URL=/editor
22
AWS_ACCESS_KEY=<your-aws-access-key>
33
AWS_REGION=<your-aws-region>
44
AWS_SECRET_KEY=<your-aws-secret-key>
5+
CORS_ALLOW_LOCALHOST=true
56
EMAIL_SENDER=<transactional-email-sender>
67
EMAIL_VERIFY_SECRET_TOKEN=whatever_you_want_this_to_be_it_only_matters_for_production
78
EXAMPLE_USER_EMAIL=[email protected]
@@ -23,3 +24,6 @@ PORT=8000
2324
S3_BUCKET=<your-s3-bucket>
2425
S3_BUCKET_URL_BASE=<alt-for-s3-url>
2526
SESSION_SECRET=whatever_you_want_this_to_be_it_only_matters_for_production
27+
UI_ACCESS_TOKEN_ENABLED=false
28+
UPLOAD_LIMIT=250000000
29+
MOBILE_ENABLED=true

.eslintrc

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"extends": "airbnb",
2+
"extends": ["airbnb", "prettier"],
33
"parser": "babel-eslint",
44
"env": {
55
"browser": true,
@@ -16,12 +16,12 @@
1616
"import/no-unresolved": 0,
1717
"import/no-named-as-default": 2,
1818
"comma-dangle": 0, // not sure why airbnb turned this on. gross!
19-
"indent": [2, 2, {"SwitchCase": 1}],
19+
"indent": 0,
2020
"no-console": 0,
2121
"no-alert": 0,
2222
"no-underscore-dangle": 0,
2323
"max-len": [1, 120, 2, {"ignoreComments": true, "ignoreTemplateLiterals": true}],
24-
"quote-props": [1, "consistent-as-needed"],
24+
"quote-props": [1, "as-needed"],
2525
"no-unused-vars": [1, {"vars": "local", "args": "none"}],
2626
"consistent-return": ["error", { "treatUndefinedAsUnspecified": true }],
2727
"no-param-reassign": [2, { "props": false }],
@@ -60,10 +60,13 @@
6060
},
6161
"allowChildren": false
6262
}
63+
],
64+
"prettier/prettier": [
65+
"error"
6366
]
6467
},
6568
"plugins": [
66-
"react", "jsx-a11y", "import"
69+
"react", "jsx-a11y", "import", "prettier"
6770
],
6871
"settings": {
6972
"import/parser": "babel-eslint",
@@ -77,5 +80,13 @@
7780
"__SERVER__": true,
7881
"__DISABLE_SSR__": true,
7982
"__DEVTOOLS__": true
80-
}
83+
},
84+
"overrides": [
85+
{
86+
"files": ["*.stories.jsx"],
87+
"rules": {
88+
"import/no-extraneous-dependencies": "off"
89+
}
90+
}
91+
]
8192
}

.github/CONTRIBUTING.md

Lines changed: 4 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,10 @@ Hello! We welcome community contributions to the p5.js Web Editor. Contributing
1515
- [Issue Search and Tagging](#issue-search-and-tagging)
1616
- [Beginning Work](#beginning-work)
1717
- [Contribution Guides](#contribution-guides)
18-
- [Writing Commit Messages](#writing-commit-messages)
19-
- [Tips](#tips)
2018

2119
## Code of Conduct
2220

23-
Please follow the guidelines in the [Code of Conduct](https://github.com/processing/p5.js-web-editor/blob/master/.github/CODE_OF_CONDUCT.md).
21+
Please follow the guidelines in the [Code of Conduct](https://github.com/processing/p5.js-web-editor/blob/develop/.github/CODE_OF_CONDUCT.md).
2422

2523
## How Can I Contribute?
2624
If you're new to open source, [read about how to contribute to open source](https://opensource.guide/how-to-contribute/).
@@ -33,6 +31,8 @@ Don't know where to begin? Here are some suggestions to get started:
3331
- Front end: React/Redux, CSS/Sass, CodeMirror
3432
- Back end: Node, Express, MongoDB, Jest, AWS
3533
- DevOps: Travis CI, Jest, Docker, Kubernetes, AWS
34+
- Documentation
35+
- Translations: Application and documentation
3636
* Use the [p5.js Web Editor](https://editor.p5js.org)! Find a bug? Think of something you think would add to the project? Open an issue.
3737
* Expand an existing issue. Sometimes issues are missing steps to reproduce, or need suggestions for potential solutions. Sometimes they need another voice saying, "this is really important!"
3838
* Try getting the project running locally on your computer by following the [installation steps](./../developer_docs/installation.md).
@@ -60,45 +60,9 @@ If you feel like an issue is tagged incorrectly (e.g. it's low priority and you
6060

6161
If you'd like to work on an issue, please comment on it to let the maintainers know, so that they can assign it to you. If someone else has already commented and taken up that issue, please refrain from working on it and submitting a PR without asking the maintainers as it leads to unnecessary duplication of effort.
6262

63-
Then, follow the [installation guide](https://github.com/processing/p5.js-web-editor/blob/master/developer_docs/installation.md) to get the project building and working on your computer.
63+
Then, look at the [development guide](https://github.com/processing/p5.js-web-editor/blob/develop/developer_docs/development.md) for instructions on how to install the project locally and follow the right development workflow.
6464

6565
### Contribution Guides
6666

6767
* [https://guides.github.com/activities/hello-world/](https://guides.github.com/activities/hello-world/)
6868
* [https://guides.github.com/activities/forking/](https://guides.github.com/activities/forking/)
69-
70-
## Writing Commit Messages
71-
72-
Good commit messages serve at least three important purposes:
73-
74-
* They speed up the reviewing process.
75-
* They help us write good release notes.
76-
* They help future maintainers understand your change and the reasons behind it.
77-
78-
Structure your commit message like this:
79-
80-
```
81-
Short (50 chars or less) summary of changes ( involving Fixes #Issue-number keyword )
82-
83-
More detailed explanatory text, if necessary. Wrap it to about 72
84-
characters or so. In some contexts, the first line is treated as the
85-
subject of an email and the rest of the text as the body. The blank
86-
line separating the summary from the body is critical (unless you omit
87-
the body entirely); tools like rebase can get confused if you run the
88-
two together.
89-
90-
Further paragraphs come after blank lines.
91-
92-
- Bullet points are okay, too
93-
94-
- Typically a hyphen or asterisk is used for the bullet, preceded by a
95-
single space, with blank lines in between, but conventions vary here
96-
```
97-
98-
* Write the summary line and description of what you have done in the imperative mode, that is as if you were commanding someone. Start the line with "Fix", "Add", "Change" instead of "Fixed", "Added", "Changed".
99-
* Always leave the second line blank.
100-
* Be as descriptive as possible in the description. It helps reasoning about the intention of commits and gives more context about why changes happened.
101-
102-
## Tips
103-
104-
* If it seems difficult to summarize what your commit does, it may be because it includes several logical changes or bug fixes, and are better split up into several commits using `git add -p`.

.github/FUNDING.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
github: processing
2+
custom: https://processingfoundation.org/

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
1+
Fixes #issue-number
2+
13
I have verified that this pull request:
24

35
* [ ] has no linting errors (`npm run lint`)
4-
* [ ] is from a uniquely-named feature branch and has been rebased on top of the latest master. (If I was asked to make more changes, I have made sure to rebase onto master then too)
5-
* [ ] is descriptively named and links to an issue number, i.e. `Fixes #123`
6+
* [ ] is from a uniquely-named feature branch and has been rebased on top of the latest `develop` branch. (If I was asked to make more changes, I have made sure to rebase onto `develop` then too)
7+
* [ ] is descriptively named and links to an issue number, i.e. `Fixes #123`

.github/config.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ newIssueWelcomeComment: >
1010

1111
# Comment to be posted to on PRs from first time contributors in your repository
1212
newPRWelcomeComment: >
13-
🎉 Thanks for opening this pull request! Please check out our [contributing guidelines](https://github.com/processing/p5.js-web-editor/blob/master/CONTRIBUTING.md) if you haven't already.
13+
🎉 Thanks for opening this pull request! Please check out our [contributing guidelines](https://github.com/processing/p5.js-web-editor/blob/develop/.github/CONTRIBUTING.md) if you haven't already.
1414
1515
# Configuration for first-pr-merge - https://github.com/behaviorbot/first-pr-merge
1616

17-
# Comment to be posted to on pull requests merged by a first time user
17+
# Comment to be posted to on pull requests merged by a first time user

.github/workflows/deploy-staging.yml

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
name: Deploy to staging
2+
on:
3+
workflow_run:
4+
workflows: ["Test"]
5+
branches:
6+
- develop
7+
types:
8+
- completed
9+
env:
10+
PROJECT_ID: ${{ secrets.GKE_PROJECT }}
11+
GKE_CLUSTER: p5js-web-editor-cluster
12+
GKE_ZONE: us-east1-c
13+
DEPLOYMENT_NAME: web-editor-node
14+
IMAGE: ${{ secrets.DOCKER_USERNAME }}/p5.js-web-editor-staging
15+
jobs:
16+
push_to_registry:
17+
environment: staging
18+
name: Push Docker image to Docker Hub
19+
runs-on: ubuntu-latest
20+
steps:
21+
- name: Check out the repo
22+
uses: actions/checkout@v2
23+
- name: Set up Docker Buildx
24+
uses: docker/setup-buildx-action@v1
25+
- name: Login to Docker Hub
26+
uses: docker/login-action@v1
27+
with:
28+
username: ${{ secrets.DOCKER_USERNAME }}
29+
password: ${{ secrets.DOCKER_PASSWORD }}
30+
- name: Build and push to Docker Hub
31+
uses: docker/build-push-action@v2
32+
with:
33+
context: .
34+
file: ./Dockerfile
35+
pull: true
36+
push: true
37+
tags: |
38+
${{ env.IMAGE }}:${{ github.sha }}
39+
${{ env.IMAGE }}:latest
40+
target: production
41+
# Setup gcloud CLI
42+
- uses: google-github-actions/[email protected]
43+
with:
44+
service_account_key: ${{ secrets.GKE_SA_KEY }}
45+
project_id: ${{ secrets.GKE_PROJECT }}
46+
47+
# Configure docker to use the gcloud command-line tool as a credential helper
48+
- run: |-
49+
gcloud --quiet auth configure-docker
50+
51+
# Get the GKE credentials so we can deploy to the cluster
52+
- uses: google-github-actions/[email protected]
53+
with:
54+
cluster_name: ${{ env.GKE_CLUSTER }}
55+
location: ${{ env.GKE_ZONE }}
56+
credentials: ${{ secrets.GKE_SA_KEY }}
57+
58+
# Deploy the Docker image to the GKE cluster
59+
- name: Deploy
60+
run: |-
61+
kubectl set image deployment/$DEPLOYMENT_NAME web-editor-app=index.docker.io/$IMAGE:$GITHUB_SHA --namespace=staging
62+
kubectl get services -o wide

.github/workflows/deploy.yml

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
name: Deploy to production
2+
on:
3+
workflow_run:
4+
workflows: ["Test"]
5+
branches:
6+
- release
7+
types:
8+
- completed
9+
env:
10+
PROJECT_ID: ${{ secrets.GKE_PROJECT }}
11+
GKE_CLUSTER: p5js-web-editor-cluster
12+
GKE_ZONE: us-east1-c
13+
DEPLOYMENT_NAME: web-editor-node
14+
IMAGE: ${{ secrets.DOCKER_USERNAME }}/p5.js-web-editor
15+
jobs:
16+
push_to_registry:
17+
environment: production
18+
name: Push Docker image to Docker Hub
19+
runs-on: ubuntu-latest
20+
steps:
21+
- name: Check out the repo
22+
uses: actions/checkout@v2
23+
- name: Set up Docker Buildx
24+
uses: docker/setup-buildx-action@v1
25+
- name: Login to Docker Hub
26+
uses: docker/login-action@v1
27+
with:
28+
username: ${{ secrets.DOCKER_USERNAME }}
29+
password: ${{ secrets.DOCKER_PASSWORD }}
30+
- name: Build and push to Docker Hub
31+
uses: docker/build-push-action@v2
32+
with:
33+
context: .
34+
file: ./Dockerfile
35+
pull: true
36+
push: true
37+
tags: |
38+
${{ env.IMAGE }}:${{ github.sha }}
39+
${{ env.IMAGE }}:latest
40+
target: production
41+
# Setup gcloud CLI
42+
- uses: google-github-actions/[email protected]
43+
with:
44+
service_account_key: ${{ secrets.GKE_SA_KEY }}
45+
project_id: ${{ secrets.GKE_PROJECT }}
46+
47+
# Configure docker to use the gcloud command-line tool as a credential helper
48+
- run: |-
49+
gcloud --quiet auth configure-docker
50+
51+
# Get the GKE credentials so we can deploy to the cluster
52+
- uses: google-github-actions/[email protected]
53+
with:
54+
cluster_name: ${{ env.GKE_CLUSTER }}
55+
location: ${{ env.GKE_ZONE }}
56+
credentials: ${{ secrets.GKE_SA_KEY }}
57+
58+
# Deploy the Docker image to the GKE cluster
59+
- name: Deploy
60+
run: |-
61+
kubectl set image deployment/$DEPLOYMENT_NAME web-editor-app=index.docker.io/$IMAGE:$GITHUB_SHA
62+
kubectl get services -o wide
63+

.github/workflows/test.yml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
name: Test
2+
3+
on: [push, pull_request]
4+
5+
jobs:
6+
test:
7+
name: Test and lint code base
8+
runs-on: ubuntu-latest
9+
steps:
10+
- uses: actions/checkout@v2
11+
- name: Use Node.js
12+
uses: actions/setup-node@v1
13+
with:
14+
node-version: '12.x'
15+
- run: npm install
16+
- run: npm run test
17+
- run: npm run lint
18+
19+

0 commit comments

Comments
 (0)